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

snyk-go-plugin

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snyk-go-plugin - npm Package Compare versions

Comparing version 1.3.4 to 1.3.5

49

lib/index.js

@@ -77,3 +77,4 @@ var fs = require('fs');

var pkgsTree = recursivelyBuildPkgTree(
graph, root, lockedVersions, projectRootPath, []);
graph, root, lockedVersions, projectRootPath, [], {});
delete pkgsTree._counts;

@@ -140,3 +141,5 @@ pkgsTree.packageFormatVersion = 'golang:0.0.1';

projectRootPath,
fromPath) {
fromPath,
counts
) {

@@ -169,9 +172,26 @@ var isRoot = (fromPath.length == 0);

pkg._counts = counts;
var children = graph.successors(node.Name);
children.forEach(function (depName) {
// We drop branches of overly common pkgs:
// this looses some paths, but avoids explosion in result size
if (pkg._counts[depName] > 50) {
return;
}
var dep = graph.node(depName);
var child = recursivelyBuildPkgTree(
graph, dep, lockedVersions, projectRootPath, pkg.from);
graph,
dep,
lockedVersions,
projectRootPath,
pkg.from,
shallowCopyMap(pkg._counts)
);
pkg._counts = sumCounts(pkg._counts, child._counts);
delete child._counts;
if (isInternalPackage(child.name) || child._isProjSubpkg) {

@@ -183,2 +203,5 @@ Object.keys(child.dependencies).forEach(function (grandChildName) {

pkg.dependencies[child.name] = child;
pkg._counts[child.name] =
(pkg._counts[child.name] ? pkg._counts[child.name] + 1 : 1);
}

@@ -190,2 +213,22 @@ })

function sumCounts(a, b) {
var sum = shallowCopyMap(a);
for (var k in b) {
sum[k] = (sum[k] ? (sum[k] + b[k]) : b[k])
}
return sum;
}
function shallowCopyMap(m) {
var copy = {};
for (var k in m) {
copy[k] = m[k]
}
return copy;
}
function isProjSubpackage(pkgPath, projectRootPath) {

@@ -192,0 +235,0 @@ if (pkgPath == projectRootPath) {

2

package.json

@@ -28,3 +28,3 @@ {

},
"version": "1.3.4"
"version": "1.3.5"
}
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