@reliverse/pathkit 1.1.7 → 1.1.8
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/bin/mod.d.ts +1 -1
- package/bin/mod.js +1 -7
- package/package.json +1 -1
package/bin/mod.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface FormatInputPathObject {
|
|
|
19
19
|
name?: string;
|
|
20
20
|
}
|
|
21
21
|
type PathExtFilter = "js" | "ts" | "none" | "js-ts-none";
|
|
22
|
-
type ImportExtType = "js" | "ts" | "none"
|
|
22
|
+
type ImportExtType = "js" | "ts" | "none";
|
|
23
23
|
/**
|
|
24
24
|
* normalizes windows paths to use forward slashes
|
|
25
25
|
*/
|
package/bin/mod.js
CHANGED
|
@@ -576,7 +576,7 @@ async function convertImportsExt({
|
|
|
576
576
|
extFrom,
|
|
577
577
|
extTo
|
|
578
578
|
}) {
|
|
579
|
-
const fromExtStr = extFrom === "none" ? "" :
|
|
579
|
+
const fromExtStr = extFrom === "none" ? "" : `.${extFrom}`;
|
|
580
580
|
const toExtStr = extTo === "none" ? "" : `.${extTo}`;
|
|
581
581
|
const importRegex = new RegExp(
|
|
582
582
|
`(?:import\\s+(?:[\\s\\S]*?)\\s+from\\s+|import\\s*\\(\\s*)\\s*(['"])([^'"]+${fromExtStr.replace(".", "\\.")})(\\1)`,
|
|
@@ -609,12 +609,6 @@ async function convertImportsExt({
|
|
|
609
609
|
let replacementPath;
|
|
610
610
|
if (extFrom === "none") {
|
|
611
611
|
replacementPath = importPath + toExtStr;
|
|
612
|
-
} else if (extFrom === "none-and-js") {
|
|
613
|
-
if (importPath.endsWith(".js")) {
|
|
614
|
-
replacementPath = importPath.slice(0, -3) + toExtStr;
|
|
615
|
-
} else {
|
|
616
|
-
replacementPath = importPath + toExtStr;
|
|
617
|
-
}
|
|
618
612
|
} else if (extTo === "none") {
|
|
619
613
|
replacementPath = importPath.slice(0, -fromExtStr.length);
|
|
620
614
|
} else {
|