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

pkgs-graph

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pkgs-graph - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

1

lib/index.d.ts

@@ -1,2 +0,1 @@

/// <reference path="../typings/index.d.ts" />
export declare type Manifest = {

@@ -3,0 +2,0 @@ name: string;

17

lib/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
///<reference path="../typings/index.d.ts"/>
const npa = require("@zkochan/npm-package-arg");

@@ -25,4 +24,8 @@ const path = require("path");

let spec;
let rawSpec = dependencies[depName];
try {
spec = npa.resolve(depName, dependencies[depName], pkg.path);
if (rawSpec.startsWith('workspace:')) {
rawSpec = rawSpec.substr(10);
}
spec = npa.resolve(depName, rawSpec, pkg.path);
}

@@ -41,3 +44,2 @@ catch (err) {

return '';
const range = dependencies[depName];
const pkgs = R.values(pkgMap).filter(pkg => pkg.manifest.name === depName);

@@ -47,9 +49,9 @@ if (!pkgs.length)

const versions = pkgs.map(pkg => pkg.manifest.version);
if (versions.indexOf(range) !== -1) {
const matchedPkg = pkgs.find(pkg => pkg.manifest.name === depName && pkg.manifest.version === range);
if (versions.indexOf(rawSpec) !== -1) {
const matchedPkg = pkgs.find(pkg => pkg.manifest.name === depName && pkg.manifest.version === rawSpec);
return matchedPkg.path;
}
const matched = semver.maxSatisfying(versions, range);
const matched = semver.maxSatisfying(versions, rawSpec);
if (!matched) {
unmatched.push({ pkgName: depName, range });
unmatched.push({ pkgName: depName, range: rawSpec });
return '';

@@ -71,2 +73,1 @@ }

}
//# sourceMappingURL=index.js.map
{
"name": "pkgs-graph",
"version": "4.0.0",
"version": "4.1.0",
"description": "Create a graph from an array of packages",

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

"lint": "tslint -c tslint.json src/**/*.ts test/**/*.ts",
"test": "npm run tsc && pnpm run lint && ts-node test --type-check",
"test": "pnpm run tsc && pnpm run lint && ts-node test --type-check",
"tsc": "tsc",
"prepublishOnly": "npm run tsc"
"prepublishOnly": "pnpm run tsc"
},

@@ -32,13 +32,7 @@ "repository": "https://github.com/pnpm/pnpm/blob/master/packages/pkgs-graph",

"devDependencies": {
"@pnpm/tslint-config": "0.0.0",
"@types/node": "*",
"@types/ramda": "^0.26.0",
"@types/semver": "^6.0.0",
"@types/tape": "^4.2.29",
"@types/semver": "6",
"better-path-resolve": "1.0.0",
"pkgs-graph": "link:",
"tape": "^4.6.3",
"ts-node": "^8.0.3",
"tslint": "5.16.0",
"typescript": "^3.0.0"
"tape": "4.11.0"
},

@@ -48,4 +42,4 @@ "dependencies": {

"ramda": "^0.26.0",
"semver": "^6.0.0"
"semver": "6.3.0"
}
}

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