Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

pear-shake

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pear-shake - npm Package Compare versions

Comparing version
2.0.2
to
2.0.3
+10
-12
index.js

@@ -34,10 +34,3 @@ 'use strict'

const hosts = [
'darwin-arm64',
'darwin-x64',
'linux-arm64',
'linux-x64',
'win32-x64',
'win32-x64'
]
const hosts = ['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x64', 'win32-x64', 'win32-x64']

@@ -56,2 +49,3 @@ module.exports = class {

const skips = []
const resolutions = []

@@ -61,9 +55,12 @@ await Promise.all(

async (entrypoint) =>
await this._traverse(entrypoint, Array.from(defer), files, skips)
await this._traverse(entrypoint, Array.from(defer), files, skips, resolutions)
) // only pass defer by value, files and skips must be passed by reference
)
return { files: [...files], skips }
const spreadResolutions = resolutions.reduce((acc, r) => {
return { ...acc, ...r }
}, {})
return { files: [...files], skips, resolutions: spreadResolutions }
}
async _traverse(entrypoint, defer, files, skips) {
async _traverse(entrypoint, defer, files, skips, resolutions) {
try {

@@ -77,2 +74,3 @@ const bundle = await pack(this._drive, entrypoint, {

for (const file of Object.keys(bundle.files)) files.add(file)
resolutions.push(bundle.resolutions)
} catch (err) {

@@ -87,3 +85,3 @@ if (err.code !== 'MODULE_NOT_FOUND') throw err

})
await this._traverse(entrypoint, defer, files, skips)
await this._traverse(entrypoint, defer, files, skips, resolutions)
}

@@ -90,0 +88,0 @@ }

{
"name": "pear-shake",
"version": "2.0.2",
"version": "2.0.3",
"main": "index.js",

@@ -23,3 +23,3 @@ "type": "commonjs",

"prettier": "^3.6.2",
"prettier-config-holepunch": "^1.0.0",
"prettier-config-holepunch": "^2.0.0",
"test-tmp": "^1.4.0"

@@ -26,0 +26,0 @@ },