Documentation
¶
Index ¶
- func IsTestFile(filePath string) bool
- func ResolveTypeScriptImportPath(sourceFile, importPath string, suppliedFiles map[string]bool) []string
- func ResolveTypeScriptProjectImports(absPath string, filePath string, ext string, suppliedFiles map[string]bool, ...) ([]string, error)
- type ExternalImport
- type InternalImport
- type Module
- type NodeBuiltinImport
- type TypeScriptImport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTestFile ¶
IsTestFile reports whether the given TypeScript/JavaScript path is a test file.
Types ¶
type ExternalImport ¶
type ExternalImport struct {
// contains filtered or unexported fields
}
ExternalImport represents an external npm package import
func (ExternalImport) IsTypeOnly ¶
func (e ExternalImport) IsTypeOnly() bool
func (ExternalImport) Path ¶
func (e ExternalImport) Path() string
type InternalImport ¶
type InternalImport struct {
// contains filtered or unexported fields
}
InternalImport represents an internal project file import (./, ../, @/)
func (InternalImport) IsTypeOnly ¶
func (i InternalImport) IsTypeOnly() bool
func (InternalImport) Path ¶
func (i InternalImport) Path() string
type Module ¶
type Module struct{}
func (Module) Extensions ¶
func (Module) IsTestFile ¶
func (Module) IsTestFile(filePath string, _ vcs.ContentReader) bool
func (Module) Maturity ¶
func (Module) Maturity() moduleapi.MaturityLevel
func (Module) NewResolver ¶
type NodeBuiltinImport ¶
type NodeBuiltinImport struct {
// contains filtered or unexported fields
}
NodeBuiltinImport represents a Node.js built-in module import (fs, path, http, node:fs)
func (NodeBuiltinImport) IsTypeOnly ¶
func (n NodeBuiltinImport) IsTypeOnly() bool
func (NodeBuiltinImport) Path ¶
func (n NodeBuiltinImport) Path() string
type TypeScriptImport ¶
TypeScriptImport represents an import in a TypeScript/TSX file
func ParseTypeScriptImports ¶
func ParseTypeScriptImports(sourceCode []byte, isTSX bool) ([]TypeScriptImport, error)
ParseTypeScriptImports parses TypeScript source code and extracts imports
func TypeScriptImports ¶
func TypeScriptImports(filePath string) ([]TypeScriptImport, error)
TypeScriptImports parses a TypeScript/TSX file and returns its imports
Click to show internal directories.
Click to hide internal directories.