MCPcopy Create free account
hub / github.com/angular/dev-infra / _resolveImport

Method _resolveImport

ng-dev/ts-circular-dependencies/analyzer.ts:97–116  ·  view source on GitHub ↗

Resolves the given import specifier with respect to the specified containing file path.

(specifier: string, containingFilePath: string)

Source from the content-addressed store, hash-verified

95
96 /** Resolves the given import specifier with respect to the specified containing file path. */
97 private _resolveImport(specifier: string, containingFilePath: string): string | null {
98 if (specifier.charAt(0) === '.') {
99 const resolvedPath = this._resolveFileSpecifier(specifier, containingFilePath);
100 if (resolvedPath === null) {
101 this._trackUnresolvedFileImport(specifier, containingFilePath);
102 }
103 return resolvedPath;
104 }
105 if (this.resolveModuleFn) {
106 const targetFile = this.resolveModuleFn(specifier);
107 if (targetFile !== null) {
108 const resolvedPath = this._resolveFileSpecifier(targetFile);
109 if (resolvedPath !== null) {
110 return resolvedPath;
111 }
112 }
113 }
114 this.unresolvedModules.add(specifier);
115 return null;
116 }
117
118 /** Tracks the given file import as unresolved. */
119 private _trackUnresolvedFileImport(specifier: string, originFilePath: string) {

Callers 1

findCyclesMethod · 0.95

Calls 3

_resolveFileSpecifierMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected