@reliverse/pathkit 1.1.3 → 1.1.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.
Files changed (2) hide show
  1. package/bin/mod.js +4 -7
  2. package/package.json +3 -3
package/bin/mod.js CHANGED
@@ -438,13 +438,9 @@ async function resolveFileWithExtensions(basePath, extensions = ["", ...EXTENSIO
438
438
  return null;
439
439
  }
440
440
  function getTargetExtension(relPath, originalExt) {
441
- const foundExt = extname(relPath);
442
441
  if (originalExt) {
443
442
  return relPath;
444
443
  }
445
- if (foundExt) {
446
- return relPath.slice(0, -foundExt.length);
447
- }
448
444
  return relPath;
449
445
  }
450
446
  async function convertStringAliasRelative({
@@ -504,10 +500,11 @@ async function processFile(filePath, aliasToReplace, targetDir, pathExtFilter) {
504
500
  pathPattern: normalizedAlias,
505
501
  targetDir
506
502
  });
507
- if (importPath !== relPath) {
508
- changes.push({ from: importPath, to: relPath });
503
+ const finalPath = pathExtFilter === "none" ? relPath.replace(/\.(ts|js|tsx|jsx|mjs|cjs)$/, "") : relPath;
504
+ if (importPath !== finalPath) {
505
+ changes.push({ from: importPath, to: finalPath });
509
506
  const searchString = `${originalQuote}${importPath}${originalQuote}`;
510
- const replacementString = `${originalQuote}${relPath}${originalQuote}`;
507
+ const replacementString = `${originalQuote}${finalPath}${originalQuote}`;
511
508
  updated = replaceAllInString(updated, searchString, replacementString);
512
509
  }
513
510
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "license": "MIT",
6
6
  "name": "@reliverse/pathkit",
7
7
  "type": "module",
8
- "version": "1.1.3",
8
+ "version": "1.1.4",
9
9
  "devDependencies": {
10
10
  "@biomejs/biome": "1.9.4",
11
11
  "@eslint/js": "^9.27.0",
@@ -14,12 +14,12 @@
14
14
  "@reliverse/relinka": "^1.4.5",
15
15
  "@reliverse/rematch": "^1.1.0",
16
16
  "@stylistic/eslint-plugin": "^4.2.0",
17
- "@types/bun": "^1.2.13",
17
+ "@types/bun": "^1.2.14",
18
18
  "@types/node": "^22.15.21",
19
19
  "eslint": "^9.27.0",
20
20
  "eslint-plugin-no-relative-import-paths": "^1.6.1",
21
21
  "eslint-plugin-perfectionist": "^4.13.0",
22
- "knip": "^5.57.1",
22
+ "knip": "^5.57.2",
23
23
  "magic-string": "^0.30.17",
24
24
  "p-map": "^7.0.3",
25
25
  "typescript": "^5.8.3",