filing-cabinet
Advanced tools
Comparing version 2.3.0 to 2.3.1
17
index.js
@@ -222,6 +222,17 @@ 'use strict'; | ||
debug('with options: ', options); | ||
const resolvedModule = ts.resolveModuleName(dependency, filename, options, host).resolvedModule; | ||
debug('ts resolved module: ', resolvedModule); | ||
const result = resolvedModule ? resolvedModule.resolvedFileName : ''; | ||
const namedModule = ts.resolveModuleName(dependency, filename, options, host); | ||
let result = ''; | ||
if (namedModule.resolvedModule) { | ||
result = namedModule.resolvedModule.resolvedFileName; | ||
} else { | ||
const suffix = '.d.ts'; | ||
const lookUpLocations = namedModule.failedLookupLocations | ||
.filter((string) => string.endsWith(suffix)) | ||
.map((string) => string.substr(0, string.length - suffix.length)); | ||
result = lookUpLocations.find(ts.sys.fileExists) || ''; | ||
} | ||
debug('result: ' + result); | ||
@@ -228,0 +239,0 @@ return result ? path.resolve(result) : ''; |
{ | ||
"name": "filing-cabinet", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Find files based on partial paths", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15690
320