@@ -138,6 +138,17 @@ function tryFileURLToPath(v) {
138
138
return v ;
139
139
}
140
140
141
+ // TODO un-copy these from resolve-uri; see if they can be exported from that lib
142
+ function isAbsoluteUrl ( input ) {
143
+ return schemeRegex . test ( input ) ;
144
+ }
145
+ // Matches the scheme of a URL, eg "http://"
146
+ const schemeRegex = / ^ [ \w + . - ] + : \/ \/ / ;
147
+ function isSchemeRelativeUrl ( input ) {
148
+ return input . startsWith ( '//' ) ;
149
+ }
150
+
151
+
141
152
// #region Caches
142
153
/** @param {string } pathOrFileUrl */
143
154
function getCacheKey ( pathOrFileUrl ) {
@@ -235,16 +246,6 @@ sharedData.internalRetrieveFileHandlers.push(function(path) {
235
246
return setFileContentsCache ( path , contents ) ;
236
247
} ) ;
237
248
238
- // TODO un-copy these from resolve-uri; see if they can be exported from that lib
239
- function isAbsoluteUrl ( input ) {
240
- return schemeRegex . test ( input ) ;
241
- }
242
- // Matches the scheme of a URL, eg "http://"
243
- const schemeRegex = / ^ [ \w + . - ] + : \/ \/ / ;
244
- function isSchemeRelativeUrl ( input ) {
245
- return input . startsWith ( '//' ) ;
246
- }
247
-
248
249
// Support URLs relative to a directory, but be careful about a protocol prefix
249
250
// in case we are in the browser (i.e. directories may start with "http://" or "file:///")
250
251
function supportRelativeURL ( file , url ) {
0 commit comments