extensionless
Advanced tools
Comparing version 1.5.4 to 1.5.5
{ | ||
"name": "extensionless", | ||
"version": "1.5.4", | ||
"version": "1.5.5", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -10,6 +10,7 @@ import {readFile} from 'fs/promises' | ||
let getPkgJson = async argv1 => { | ||
let curDir, upDir = isAbsolute(argv1 ?? '') ? argv1 : cwd() | ||
let path = isAbsolute(argv1 ?? '') ? argv1 : cwd() | ||
do { | ||
try { | ||
return JSON.parse(await readFile(join(curDir = upDir, 'package.json'), 'utf8')) | ||
return JSON.parse(await readFile(join(path, 'package.json'), 'utf8')) | ||
} catch (e) { | ||
@@ -20,3 +21,3 @@ if (!['ENOTDIR', 'ENOENT', 'EISDIR'].includes(e.code)) { | ||
} | ||
} while (curDir !== (upDir = dirname(curDir))) | ||
} while (path !== (path = dirname(path))) | ||
} | ||
@@ -23,0 +24,0 @@ |
@@ -21,4 +21,6 @@ import {extname, isAbsolute} from 'path' | ||
let extToSkip = ['.js', '.cjs', '.mjs', '.json', '.node', '.wasm'], empty = [[], []] | ||
export async function resolve(specifier, {importAssertions, parentURL}, nextResolve) { | ||
let isAbs = isAbsolute(specifier) | ||
if (!isAbs && !relSpecs.includes(specifier) && !prefixes.some(p => specifier.startsWith(p))) { | ||
@@ -29,3 +31,2 @@ return await nextResolve(specifier) | ||
await initPromise | ||
let selfURL = new URL((isAbs ? 'file://' : '') + specifier, parentURL).href | ||
@@ -32,0 +33,0 @@ let postfixes = selfURL.endsWith('/') ? indexFiles : extToSkip.includes(extname(selfURL)) ? empty : candidates |
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
6462