Socket
Socket
Sign inDemoInstall

dependency-graph

Package Overview
Dependencies
0
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.2.0

6

CHANGELOG.md
# Dependency Graph Changelog
## In development
## 0.2.0 (May 1, 2015)
- Removed dependency on Underscore - thanks [myndzi](https://github.com/myndzi)! (Fixes #1)
## 0.1.0 (May 18, 2013)
- Initial Release - extracted out of asset-smasher

16

lib/dep_graph.js
/**
* A simple dependency graph
*/
var _ = require('underscore');

@@ -54,8 +53,8 @@ /**

delete this.incomingEdges[name];
_.each(this.incomingEdges, function (edges) {
var idx = edges.indexOf(name);
Object.keys(this.incomingEdges).forEach(function (key) {
var idx = this.incomingEdges[key].indexOf(name);
if (idx >= 0) {
edges.splice(idx, 1);
}
});
}, this);
},

@@ -121,8 +120,9 @@ hasNode:function (name) {

var DFS = createDFS(this.outgoingEdges, leavesOnly, result);
_.each(_.filter(_.keys(this.nodes), function (node) {
var keys = Object.keys(this.nodes);
keys.filter(function (node) {
return self.incomingEdges[node].length === 0;
}), function (n) {
}).forEach(function (n) {
DFS(n);
});
if (_.size(this.nodes) > 0 && result.length === 0) {
if (keys.length > 0 && result.length === 0) {
// Special case when there are no nodes with no dependants

@@ -133,2 +133,2 @@ throw new Error('Dependency Cycle Found');

}
};
};
{
"name": "dependency-graph",
"description": "Simple dependency graph.",
"version": "0.1.0",
"version": "0.2.0",
"author": "Jim Riecken <jriecken@gmail.com>",

@@ -25,8 +25,6 @@ "keywords": [

},
"dependencies": {
"underscore": "1.4.4"
},
"dependencies": {},
"optionalDependencies": {},
"devDependencies": {
"jasmine-node": "1.7.1"
"jasmine-node": "1.14.5"
},

@@ -33,0 +31,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc