Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit 5d57d74

Browse files
committed
fix: isFilePath not working on windows
1 parent 7e33d7c commit 5d57d74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import fs from 'fs';
55
const noop = () => null;
66
const startsWith = (needle, haystack) => ! haystack.indexOf(needle);
77
const endsWith = (needle, haystack) => haystack.slice(-needle.length) === needle;
8-
const isFilePath = id => /^\.?\//.test(id);
8+
const isFilePath = id => new RegExp(`^\.?\\${path.sep}`).test(id);
99
const exists = uri => {
1010
try {
1111
return fs.statSync(uri).isFile();

0 commit comments

Comments
 (0)