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

@pnpm/lockfile-walker

Package Overview
Dependencies
Maintainers
3
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/lockfile-walker - npm Package Compare versions

Comparing version 2.0.3-alpha.1 to 3.0.0

14

CHANGELOG.md
# @pnpm/lockfile-walker
## 3.0.0
### Major Changes
- 142f8caf7: Rename `relDepPath` to `depPath`.
### Patch Changes
- Updated dependencies [da091c711]
- Updated dependencies [6a8a97eee]
- @pnpm/types@6.0.0
- @pnpm/lockfile-types@2.0.1
- dependency-path@4.0.7
## 2.0.3-alpha.1

@@ -4,0 +18,0 @@

4

lib/index.d.ts
import { Lockfile, PackageSnapshot } from '@pnpm/lockfile-types';
import { DependenciesField } from '@pnpm/types';
export declare type LockedDependency = {
relDepPath: string;
depPath: string;
pkgSnapshot: PackageSnapshot;

@@ -30,5 +30,5 @@ next: () => LockfileWalkerStep;

alias: string;
relDepPath: string;
depPath: string;
}[];
step: LockfileWalkerStep;
};

@@ -43,7 +43,7 @@ "use strict";

.forEach(([pkgName, reference]) => {
const relDepPath = dp.refToRelative(reference, pkgName);
if (relDepPath === null)
const depPath = dp.refToRelative(reference, pkgName);
if (depPath === null)
return;
entryNodes.push(relDepPath);
directDeps.push({ alias: pkgName, relDepPath });
entryNodes.push(depPath);
directDeps.push({ alias: pkgName, depPath });
});

@@ -61,3 +61,3 @@ });

exports.default = lockfileWalker;
function step(ctx, nextRelDepPaths) {
function step(ctx, nextDepPaths) {
var _a;

@@ -69,19 +69,19 @@ const result = {

};
for (let relDepPath of nextRelDepPaths) {
if (ctx.walked.has(relDepPath))
for (let depPath of nextDepPaths) {
if (ctx.walked.has(depPath))
continue;
ctx.walked.add(relDepPath);
const pkgSnapshot = (_a = ctx.lockfile.packages) === null || _a === void 0 ? void 0 : _a[relDepPath];
ctx.walked.add(depPath);
const pkgSnapshot = (_a = ctx.lockfile.packages) === null || _a === void 0 ? void 0 : _a[depPath];
if (!pkgSnapshot) {
if (relDepPath.startsWith('link:')) {
result.links.push(relDepPath);
if (depPath.startsWith('link:')) {
result.links.push(depPath);
continue;
}
result.missing.push(relDepPath);
result.missing.push(depPath);
continue;
}
result.dependencies.push({
depPath,
next: () => step(ctx, next({ includeOptionalDependencies: ctx.includeOptionalDependencies }, pkgSnapshot)),
pkgSnapshot,
relDepPath,
});

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

{
"name": "@pnpm/lockfile-walker",
"version": "2.0.3-alpha.1",
"version": "3.0.0",
"description": "Walk over all the dependencies in a lockfile",

@@ -38,5 +38,5 @@ "main": "lib/index.js",

"dependencies": {
"@pnpm/lockfile-types": "2.0.1-alpha.0",
"@pnpm/types": "6.0.0-alpha.0",
"dependency-path": "4.0.7-alpha.0",
"@pnpm/lockfile-types": "2.0.1",
"@pnpm/types": "6.0.0",
"dependency-path": "4.0.7",
"ramda": "0.27.0"

@@ -43,0 +43,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