Skip to content

Commit

Permalink
Don't lean on startsWith support
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Jan 16, 2018
1 parent ca8f6cb commit 3bd9b4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source-map-support.js
Expand Up @@ -64,7 +64,7 @@ var retrieveFile = handlerExec(retrieveFileHandlers);
retrieveFileHandlers.push(function(path) {
// Trim the path to make sure there is no extra whitespace.
path = path.trim();
if (path.startsWith('file:')) {
if (/^file:/.test(path)) {
// existsSync/readFileSync can't handle file protocol, but once stripped, it works
path = path.replace(/file:\/\/(\w:\\|\/)/, '');
}
Expand Down

0 comments on commit 3bd9b4b

Please sign in to comment.