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

@jsenv/node-esm-resolution

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsenv/node-esm-resolution - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

package.json
{
"name": "@jsenv/node-esm-resolution",
"version": "0.0.4",
"version": "0.0.5",
"license": "MIT",

@@ -5,0 +5,0 @@ "repository": {

@@ -107,3 +107,7 @@ /*

const applyBrowserFieldResolution = ({ conditions, parentUrl, specifier }) => {
const applyBrowserFieldResolution = ({
conditions,
parentUrl,
packageSpecifier,
}) => {
const browserCondition = conditions.includes("browser")

@@ -129,18 +133,20 @@ if (!browserCondition) {

let url
if (specifier.startsWith(".")) {
const specifierUrl = new URL(specifier, parentUrl).href
const specifierRelativeToPackage = specifierUrl.slice(packageUrl.length)
const specifierRelativeNotation = `./${specifierRelativeToPackage}`
const browserMapping = browser[specifierRelativeNotation]
if (packageSpecifier.startsWith(".")) {
const packageSpecifierUrl = new URL(packageSpecifier, parentUrl).href
const packageSpecifierRelativeUrl = packageSpecifierUrl.slice(
packageUrl.length,
)
const packageSpecifierRelativeNotation = `./${packageSpecifierRelativeUrl}`
const browserMapping = browser[packageSpecifierRelativeNotation]
if (typeof browserMapping === "string") {
url = new URL(browserMapping, packageUrl).href
} else if (browserMapping === false) {
url = `file:///@ignore/${specifierUrl.slice("file:///")}`
url = `file:///@ignore/${packageSpecifierUrl.slice("file:///")}`
}
} else {
const browserMapping = browser[specifier]
const browserMapping = browser[packageSpecifier]
if (typeof browserMapping === "string") {
url = new URL(browserMapping, packageUrl).href
} else if (browserMapping === false) {
url = `file:///@ignore/${specifier}`
url = `file:///@ignore/${packageSpecifier}`
}

@@ -147,0 +153,0 @@ }

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