Skip to content

Commit ff8b538

Browse files
authored
fix: path-shim extname (#64)
1 parent 87c7f7f commit ff8b538

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/brown-birds-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"vite-plugin-eslint4b": patch
3+
---
4+
5+
fix: path-shim extname

shim/path-shim.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function basename(p, ext) {
88
}
99

1010
export function extname(p) {
11-
return /\.[^.]+$/u.exec(p)[0];
11+
return /\.[^.]+$/u.exec(p)?.[0] || "";
1212
}
1313

1414
export function relative(from, to) {
@@ -43,7 +43,7 @@ export function parse(s) {
4343
dir,
4444
base,
4545
ext,
46-
name: basename(ext, ext),
46+
name: basename(base, ext),
4747
};
4848
}
4949

0 commit comments

Comments
 (0)