extensionless
Advanced tools
Comparing version 1.9.7 to 1.9.8
{ | ||
"name": "extensionless", | ||
"version": "1.9.7", | ||
"version": "1.9.8", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -8,8 +8,8 @@ import {readFile} from 'fs/promises' | ||
let getPkgJson = async argv1 => { | ||
let path, dirPath = isAbsolute(argv1 ?? '') ? argv1 : cwd() | ||
let getPkgJson = async dirPath => { | ||
do { | ||
let path = join(dirPath, 'package.json') | ||
do { | ||
try { | ||
return {body: JSON.parse(await readFile(path = join(dirPath, 'package.json'), 'utf8')), path} | ||
return {body: JSON.parse(await readFile(path, 'utf8')), path} | ||
} catch (e) { | ||
@@ -26,5 +26,5 @@ if (!['ENOTDIR', 'ENOENT', 'EISDIR'].includes(e.code)) { | ||
lookFor: ['js'] | ||
}, pkgJson = await getPkgJson(argv1), { | ||
}, dirPath = isAbsolute(argv1 ?? '') ? argv1 : cwd(), { | ||
lookFor | ||
} = {...defaults, ...pkgJson?.body.extensionless} | ||
} = {...defaults, ...(await getPkgJson(dirPath))?.body.extensionless} | ||
@@ -35,3 +35,3 @@ Array.isArray(lookFor) && lookFor.length && lookFor.every(a => typeof a === 'string' && /^[a-z]\w*$/i.test(a)) || ( | ||
return {lookFor, pkgJsonPath: pkgJson?.path} | ||
return {lookFor} | ||
} |
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
6664