@jspm/import-map
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -27,3 +27,3 @@ var ref; | ||
function resolve(url, mapUrl, rootUrl) { | ||
if (url.startsWith('/') || url.startsWith('//')) return rootUrl ? new URL(url, rootUrl).href : url; | ||
if (url.startsWith('/')) return rootUrl ? new URL('.' + url.slice(url[1] === '/' ? 1 : 0), rootUrl).href : url; | ||
return new URL(url, mapUrl).href; | ||
@@ -30,0 +30,0 @@ } |
@@ -27,3 +27,3 @@ var ref; | ||
export function resolve(url, mapUrl, rootUrl) { | ||
if (url.startsWith('/') || url.startsWith('//')) return rootUrl ? new URL(url, rootUrl).href : url; | ||
if (url.startsWith('/')) return rootUrl ? new URL('.' + url.slice(url[1] === '/' ? 1 : 0), rootUrl).href : url; | ||
return new URL(url, mapUrl).href; | ||
@@ -30,0 +30,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"types": "src/map.ts", | ||
@@ -8,0 +8,0 @@ "type": "module", |
@@ -45,4 +45,4 @@ declare global { | ||
export function resolve (url: string, mapUrl: URL, rootUrl: URL | null): string { | ||
if (url.startsWith('/') || url.startsWith('//')) | ||
return rootUrl ? new URL(url, rootUrl).href : url; | ||
if (url.startsWith('/')) | ||
return rootUrl ? new URL('.' + url.slice(url[1] === '/' ? 1 : 0), rootUrl).href : url; | ||
return new URL(url, mapUrl).href; | ||
@@ -49,0 +49,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
161067