dependency-cruiser 16.0.0-beta-3 → 16.0.0-beta-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
1
2
|
import { isAbsolute, resolve as path_resolve } from "node:path";
|
|
2
3
|
import { join as posix_join } from "node:path/posix";
|
|
3
4
|
import { isMatch } from "picomatch";
|
|
@@ -219,6 +220,8 @@ function stripIndex(pModulePath) {
|
|
|
219
220
|
*
|
|
220
221
|
* https://www.typescriptlang.org/docs/handbook/modules/reference.html#baseurl
|
|
221
222
|
*
|
|
223
|
+
* Assumes the pModuleName is not relative.
|
|
224
|
+
*
|
|
222
225
|
* @param {string} pModuleName
|
|
223
226
|
* @param {string} pResolvedModuleName
|
|
224
227
|
* @param {string} pTSConfigBaseURL
|
|
@@ -228,7 +231,13 @@ function matchesTSConfigBaseURL(
|
|
|
228
231
|
pResolvedModuleName,
|
|
229
232
|
pTSConfigBaseURL,
|
|
230
233
|
) {
|
|
231
|
-
|
|
234
|
+
// the pModuleName === pResolvedModuleName check is there to prevent
|
|
235
|
+
// false positives for core modules ('fs' resolved === 'fs') and modules that
|
|
236
|
+
// we couldn't resolve at all (e.g. 'this/does/not/exist' => 'this/does/not/exist')
|
|
237
|
+
//
|
|
238
|
+
// we could also check whether the moduleName is relative, but that's
|
|
239
|
+
// not efficient as that was already done before this function was called.
|
|
240
|
+
if (!pTSConfigBaseURL || pModuleName === pResolvedModuleName) {
|
|
232
241
|
return false;
|
|
233
242
|
}
|
|
234
243
|
// "If baseUrl is set, TypeScript will resolve non-relative module names
|