extensionless
Advanced tools
Comparing version 1.3.0 to 1.3.1
{ | ||
"name": "extensionless", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -18,4 +18,6 @@ import {access, existsSync, readFileSync} from 'fs' | ||
Array.isArray(lookFor) && lookFor.length && lookFor.every(a => typeof a === 'string' && /^[a-z]+\w*$/i.test(a)) | ||
|| (console.error('\x1b[31m%s\x1b[0m', `The package.json field 'extensionless.lookFor' must be an array of alphanumeric strings!`), process.exit(1)) | ||
Array.isArray(lookFor) && lookFor.length && lookFor.every(a => typeof a === 'string' && /^[a-z]+\w*$/i.test(a)) || ( | ||
console.error('\n❌ \x1b[31m%s\x1b[0m', `Error: The package.json field 'extensionless.lookFor' must be an array of alphanumeric strings!`), | ||
process.exit(1) | ||
) | ||
@@ -31,6 +33,6 @@ let indexFiles = [lookFor.map(e => `index.${e}`), ['index.json']] | ||
export async function resolve(specifier, {importAssertions, parentURL}, nextResolve) { | ||
let isAbsPath = isAbsolute(specifier), isRelSpec = relSpecs.includes(specifier) | ||
let isRelSpec = relSpecs.includes(specifier) | ||
let isRelative = isRelSpec || relPrefixes.some(p => specifier.startsWith(p)) | ||
if (isAbsPath || isRelative || specifier.startsWith('file://')) { | ||
if (isRelative || isAbsolute(specifier) || specifier.startsWith('file://')) { | ||
let postfixes = isRelSpec ? relatives | ||
@@ -37,0 +39,0 @@ : separators.some(s => specifier.endsWith(s)) ? indexFiles |
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
39
5666