extensionless
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "extensionless", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"type": "module", | ||
@@ -20,4 +20,4 @@ "main": "src/index.js", | ||
"scripts": { | ||
"test": "true" | ||
"test": "node --experimental-loader=./src/index.js test" | ||
} | ||
} |
@@ -22,7 +22,7 @@ import {access, existsSync, readFileSync} from 'fs' | ||
let extToSkip = ['.wasm', '.cjs', '.mjs', '.js', '.json'], emptyPostfixes = [[], []] | ||
let extToSkip = ['.wasm', '.cjs', '.mjs', '.js', '.json'], none = [[], []] | ||
let indexFiles = [lookFor.map(e => `index.${e}`), ['index.json']] | ||
let extensions = [lookFor.map(e => `.${e}`).concat(lookFor.map(e => `${sep}index.${e}`)), ['.json', `${sep}index.json`]] | ||
let candidates = [lookFor.map(e => `.${e}`).concat(lookFor.map(e => `${sep}index.${e}`)), ['.json', `${sep}index.json`]] | ||
let findPostfix = async (specifier, {importAssertions, parentURL}, isAbsPath) => { | ||
let postfixes = specifier.endsWith(sep) ? indexFiles : extToSkip.includes(extname(specifier)) ? emptyPostfixes : extensions | ||
let postfixes = specifier.endsWith(sep) ? indexFiles : extToSkip.includes(extname(specifier)) ? none : candidates | ||
@@ -29,0 +29,0 @@ for (let postfix of postfixes[+(importAssertions?.type === 'json')]) { |
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
4857