Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extensionless

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extensionless - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

package.json
{
"name": "extensionless",
"version": "1.1.1",
"version": "1.1.2",
"type": "module",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -27,9 +27,11 @@ import {access, existsSync, readFileSync} from 'fs'

let extToSkip = ['.wasm', '.cjs', '.mjs', '.js', '.json']
let indexFiles = resolveDirs ? lookFor.map(e => `index.${e}`) : []
let postfixes = lookFor.map(e => `.${e}`).concat(indexFiles.map(p => `${sep}${p}`))
let findPostfix = async (specifier, context) => {
let isAbsolutePath = isAbsolute(specifier)
for (let postfix of specifier.endsWith(sep) ? indexFiles : postfixes) {
let path = isAbsolutePath
? specifier + postfix
let findPostfix = async (specifier, context, isAbs) => {
let postfixCandidates = specifier.endsWith(sep) ? indexFiles
: extToSkip.includes(extname(spec)) ? [] : postfixes
for (let postfix of postfixCandidates) {
let path = isAbs ? specifier + postfix
: join(dirname(fileURLToPath(context.parentURL)), specifier + postfix)

@@ -43,13 +45,11 @@

let extToSkip = ['.wasm', '.cjs', '.mjs', '.js', '.json']
let relPrefixes = [...new Set(['./', '../', `.${sep}`, `..${sep}`])]
export async function resolve(specifier, context, nextResolve) {
let spec = specifier.startsWith('file://') ? fileURLToPath(specifier) : specifier
let isAbs = isAbsolute(spec)
let postfix = (isAbsolute(spec) || relPrefixes.some(p => spec.startsWith(p)))
&& (spec = normalize(spec))
&& (spec.endsWith(sep) || !extToSkip.includes(extname(spec)))
&& await findPostfix(spec, context)
let postfix = (isAbs || relPrefixes.some(p => spec.startsWith(p)))
&& await findPostfix(normalize(spec), context, isAbs) || ''
return await nextResolve(specifier + (postfix || ''))
return await nextResolve(specifier + postfix)
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc