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,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-cruiser",
3
- "version": "16.0.0-beta-3",
3
+ "version": "16.0.0-beta-4",
4
4
  "description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
5
5
  "keywords": [
6
6
  "static analysis",
@@ -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
- if (!pTSConfigBaseURL) {
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
package/src/meta.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* generated - don't edit */
2
2
 
3
3
  module.exports = {
4
- version: "16.0.0-beta-3",
4
+ version: "16.0.0-beta-4",
5
5
  engines: {
6
6
  node: "^18.17||>=20",
7
7
  },