From fc3f549213ea8fde85d3a47a8b8204e7e1f705b4 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Fri, 29 Apr 2022 18:08:39 -0400 Subject: [PATCH] WIP --- source-map-support.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/source-map-support.js b/source-map-support.js index b4280f8..a1d89b7 100644 --- a/source-map-support.js +++ b/source-map-support.js @@ -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) { @@ -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) {