extensionless
Advanced tools
Comparing version 1.2.3 to 1.2.4
{ | ||
"name": "extensionless", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -41,3 +41,3 @@ Node.js loader for import specifiers as file paths without extensions or as directory paths | ||
If it can be deduced from the specifier that its target is a directory, the resolver looks for only the index files: | ||
When it can be deduced from the specifier that its target is a directory, the resolver looks for only the index files: | ||
@@ -44,0 +44,0 @@ ```js |
import {access, existsSync, readFileSync} from 'fs' | ||
import {dirname, extname, isAbsolute, join, normalize} from 'path' | ||
import {dirname, extname, isAbsolute, join, win32} from 'path' | ||
import {argv, cwd} from 'process' | ||
@@ -39,4 +39,5 @@ import {fileURLToPath} from 'url' | ||
let path = join(isAbsPath ? '' : dirname(fileURLToPath(parentURL)), spec + post) | ||
let reqsWin32Fix = path.startsWith(win32.sep) | ||
if (await new Promise(resolve => access(normalize(path), e => resolve(!e)))) { | ||
if (await new Promise(r => access(path.substring(+reqsWin32Fix), e => r(!e)))) { | ||
return await nextResolve(specifier + post) | ||
@@ -43,0 +44,0 @@ } |
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
5240
37