extensionless
Advanced tools
Comparing version 1.7.3 to 1.8.0
{ | ||
"name": "extensionless", | ||
"version": "1.7.3", | ||
"version": "1.8.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -20,3 +20,3 @@ import {extname} from 'path' | ||
let winAbsPath = /^[/\\]?[a-z]:[/\\]/i, relSpecs = ['.', '..'] | ||
let specStarts = ['./', '../', '/', 'file://', 'https://', '.\\', '..\\', '\\'] | ||
let specStarts = ['./', '../', '/', '#', 'file://', 'https://', '.\\', '..\\', '\\'] | ||
let knownExts = ['.js', '.cjs', '.mjs', '.json', '.node', '.wasm'], empty = [[], []] | ||
@@ -31,14 +31,14 @@ | ||
let selfURL = new URL(prefix + specifier, context.parentURL).href | ||
let trySpec = specifier[0] === '#' ? specifier : new URL(prefix + specifier, context.parentURL).href | ||
let {type} = context.importAttributes ?? context.importAssertions | ||
let postfixes = (await initPromise, selfURL.endsWith('/') ? indexFiles : knownExts.includes(extname(selfURL)) ? empty : candidates) | ||
let postfixes = (await initPromise, trySpec.endsWith('/') ? indexFiles : knownExts.includes(extname(trySpec)) ? empty : candidates) | ||
for (let postfix of postfixes[+(type === 'json')]) { | ||
try { | ||
return await nextResolve(selfURL + postfix) | ||
return await nextResolve(trySpec + postfix) | ||
} catch {} | ||
} | ||
return await nextResolve(selfURL) | ||
return await nextResolve(trySpec) | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6590