Skip to content

Commit

Permalink
fix: add path.parse() shim (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi authored Jun 18, 2024
1 parent 10cc973 commit 3d7657f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-candles-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-plugin-eslint4b": patch
---

fix: add path.parse() shim
13 changes: 13 additions & 0 deletions shim/path-shim.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ export function join(...args) {
return args.join("/");
}

export function parse(s) {
const dir = dirname(s);
const ext = extname(s);
const base = basename(s);
return {
root: "",
dir,
base,
ext,
name: basename(ext, ext),
};
}

export const sep = "/";

export const posix = {
Expand Down

0 comments on commit 3d7657f

Please sign in to comment.