extensionless
Advanced tools
Comparing version 1.3.5 to 1.4.0
{ | ||
"name": "extensionless", | ||
"version": "1.3.5", | ||
"version": "1.4.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -1,2 +0,2 @@ | ||
import {access, existsSync, readFileSync} from 'fs' | ||
import {readFileSync, stat} from 'fs' | ||
import {dirname, extname, isAbsolute, join} from 'path' | ||
@@ -7,6 +7,6 @@ import {argv, cwd} from 'process' | ||
do { | ||
let path = join(curDir = upDir, 'package.json') | ||
if (existsSync(path)) { | ||
pkgJson = JSON.parse(readFileSync(path, 'utf8')) | ||
try { | ||
pkgJson = JSON.parse(readFileSync(join(curDir = upDir, 'package.json'), 'utf8')) | ||
} catch (e) { | ||
if (e.code !== 'ENOENT' && e.code !== 'EISDIR') throw e | ||
} | ||
@@ -43,3 +43,3 @@ } while (!pkgJson && curDir !== (upDir = dirname(curDir))) | ||
if (await new Promise(r => access(new URL(testURL), e => r(!e)))) { | ||
if ((await new Promise(r => stat(new URL(testURL), (_, s) => r(s))))?.isFile()) { | ||
return await nextResolve(testURL) | ||
@@ -46,0 +46,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
5527
37