Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Apr 29, 2022
1 parent 0582d53 commit fc3f549
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions source-map-support.js
Expand Up @@ -138,6 +138,17 @@ function tryFileURLToPath(v) {
return v;
}

// TODO un-copy these from resolve-uri; see if they can be exported from that lib
function isAbsoluteUrl(input) {
return schemeRegex.test(input);
}
// Matches the scheme of a URL, eg "http://"
const schemeRegex = /^[\w+.-]+:\/\//;
function isSchemeRelativeUrl(input) {
return input.startsWith('//');
}


// #region Caches
/** @param {string} pathOrFileUrl */
function getCacheKey(pathOrFileUrl) {
Expand Down Expand Up @@ -235,16 +246,6 @@ sharedData.internalRetrieveFileHandlers.push(function(path) {
return setFileContentsCache(path, contents);
});

// TODO un-copy these from resolve-uri; see if they can be exported from that lib
function isAbsoluteUrl(input) {
return schemeRegex.test(input);
}
// Matches the scheme of a URL, eg "http://"
const schemeRegex = /^[\w+.-]+:\/\//;
function isSchemeRelativeUrl(input) {
return input.startsWith('//');
}

// Support URLs relative to a directory, but be careful about a protocol prefix
// in case we are in the browser (i.e. directories may start with "http://" or "file:///")
function supportRelativeURL(file, url) {
Expand Down

0 comments on commit fc3f549

Please sign in to comment.