diff --git a/src/index.js b/src/index.js index ac8472a..0f37857 100644 --- a/src/index.js +++ b/src/index.js @@ -15,7 +15,7 @@ const matches = (key, importee) => { return importeeStartsWithKey && importeeHasSlashAfterKey; }; const endsWith = (needle, haystack) => haystack.slice(-needle.length) === needle; -const isFilePath = id => /^\.?\//.test(id); +const isFilePath = id => new RegExp(`^\\.?\\${path.sep}`).test(id); const exists = uri => { try { return fs.statSync(uri).isFile();