Skip to content

Commit 7b1bc95

Browse files
committed
fix: make filePaths platform agnostic
Use `path.sep` as the file separator instead of `/` so that this works on both Windows and Unix. Rename input parameter from `path` to `modulePath` so that it doesn't override `node:path`
1 parent 7d2642d commit 7b1bc95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ const isFile = (path?: string | undefined): path is string => {
250250
}
251251
}
252252

253-
const isModule = (path?: string | undefined): path is string => {
254-
return !!path && isFile(`${path}/package.json`)
253+
const isModule = (modulePath?: string | undefined): modulePath is string => {
254+
return !!modulePath && isFile(`${modulePath}${path.sep}package.json`)
255255
}
256256

257257
/**

0 commit comments

Comments
 (0)