@jsenv/node-esm-resolution
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "@jsenv/node-esm-resolution", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -38,10 +38,10 @@ import { statSync } from "node:fs" | ||
return { | ||
...result, | ||
magicDirectoryIndex: true, | ||
...result, | ||
} | ||
} | ||
return { | ||
isDirectory: true, | ||
found: true, | ||
url: fileUrl, | ||
isDirectory: true, | ||
} | ||
@@ -60,5 +60,5 @@ } | ||
return { | ||
magicExtension: extensionLeadingToFile, | ||
found: true, | ||
url: `${fileUrl}${extensionLeadingToFile}`, | ||
magicExtension: extensionLeadingToFile, | ||
} | ||
@@ -65,0 +65,0 @@ } |
@@ -767,22 +767,32 @@ /* | ||
const mainLegacyResolvers = { | ||
import: ({ module, jsnext }) => { | ||
if (typeof module === "string") { | ||
return { type: "module", path: module } | ||
import: (packageJson) => { | ||
if (typeof packageJson.module === "string") { | ||
return { type: "module", path: packageJson.module } | ||
} | ||
if (typeof jsnext === "string") { | ||
return { type: "jsnext", path: jsnext } | ||
if (typeof packageJson.jsnext === "string") { | ||
return { type: "jsnext", path: packageJson.jsnext } | ||
} | ||
return null | ||
}, | ||
browser: ({ browser, module }, packageUrl) => { | ||
browser: (packageJson, packageUrl) => { | ||
const browserMain = | ||
typeof browser === "string" | ||
? browser | ||
: typeof browser === "object" && browser !== null | ||
? browser["."] | ||
typeof packageJson.browser === "string" | ||
? packageJson.browser | ||
: typeof packageJson.browser === "object" && | ||
packageJson.browser !== null | ||
? packageJson.browser["."] | ||
: "" | ||
if (!browserMain) { | ||
if (typeof packageJson.module === "string") { | ||
return { | ||
type: "module", | ||
path: packageJson.module, | ||
} | ||
} | ||
return null | ||
} | ||
if (typeof module !== "string" || module === browserMain) { | ||
if ( | ||
typeof packageJson.module !== "string" || | ||
packageJson.module === browserMain | ||
) { | ||
return { | ||
@@ -802,3 +812,3 @@ type: "browser", | ||
type: "module", | ||
path: module, | ||
path: packageJson.module, | ||
} | ||
@@ -811,7 +821,7 @@ } | ||
}, | ||
node: ({ main }) => { | ||
if (typeof main === "string") { | ||
node: (packageJson) => { | ||
if (typeof packageJson.main === "string") { | ||
return { | ||
type: "main", | ||
path: main, | ||
path: packageJson.main, | ||
} | ||
@@ -818,0 +828,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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
32043
1211
1