Skip to content

Commit

Permalink
fix: path-shim extname (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi authored Jun 18, 2024
1 parent 87c7f7f commit ff8b538
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-birds-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-plugin-eslint4b": patch
---

fix: path-shim extname
4 changes: 2 additions & 2 deletions shim/path-shim.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function basename(p, ext) {
}

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

export function relative(from, to) {
Expand Down Expand Up @@ -43,7 +43,7 @@ export function parse(s) {
dir,
base,
ext,
name: basename(ext, ext),
name: basename(base, ext),
};
}

Expand Down

0 comments on commit ff8b538

Please sign in to comment.