New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pnpm/workspace.pkgs-graph

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/workspace.pkgs-graph - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

33

lib/index.js

@@ -14,8 +14,4 @@ "use strict";

const pkgMapValues = Object.values(pkgMap);
const pkgMapByManifestName = {};
for (const pkg of pkgMapValues) {
if (pkg.manifest.name) {
(pkgMapByManifestName[pkg.manifest.name] ??= []).push(pkg);
}
}
let pkgMapByManifestName;
let pkgMapByDir;
const unmatched = [];

@@ -50,2 +46,9 @@ const graph = (0, map_1.default)((pkg) => ({

if (spec.type === 'directory') {
pkgMapByDir ??= getPkgMapByDir(pkgMapValues);
const resolvedPath = path_1.default.resolve(pkg.dir, spec.fetchSpec);
const found = pkgMapByDir[resolvedPath];
if (found) {
return found.dir;
}
// Slow path; only needed when there are case mismatches on case-insensitive filesystems.
const matchedPkg = pkgMapValues.find(pkg => path_1.default.relative(pkg.dir, spec.fetchSpec) === '');

@@ -55,2 +58,3 @@ if (matchedPkg == null) {

}
pkgMapByDir[resolvedPath] = matchedPkg;
return matchedPkg.dir;

@@ -60,2 +64,3 @@ }

return '';
pkgMapByManifestName ??= getPkgMapByManifestName(pkgMapValues);
const pkgs = pkgMapByManifestName[depName];

@@ -99,2 +104,18 @@ if (!pkgs || pkgs.length === 0)

}
function getPkgMapByManifestName(pkgMapValues) {
const pkgMapByManifestName = {};
for (const pkg of pkgMapValues) {
if (pkg.manifest.name) {
(pkgMapByManifestName[pkg.manifest.name] ??= []).push(pkg);
}
}
return pkgMapByManifestName;
}
function getPkgMapByDir(pkgMapValues) {
const pkgMapByDir = {};
for (const pkg of pkgMapValues) {
pkgMapByDir[path_1.default.resolve(pkg.dir)] = pkg;
}
return pkgMapByDir;
}
//# sourceMappingURL=index.js.map

4

package.json
{
"name": "@pnpm/workspace.pkgs-graph",
"version": "2.0.2",
"version": "2.0.3",
"description": "Create a graph from an array of packages",

@@ -23,3 +23,3 @@ "main": "lib/index.js",

"better-path-resolve": "1.0.0",
"@pnpm/workspace.pkgs-graph": "2.0.2"
"@pnpm/workspace.pkgs-graph": "2.0.3"
},

@@ -26,0 +26,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

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