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

mako-tree

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mako-tree - npm Package Compare versions

Comparing version 0.10.1 to 0.11.0

5

HISTORY.md
0.11.0 / 2016-02-10
===================
* adding a method for removing cycles from a tree
0.10.1 / 2016-02-09

@@ -3,0 +8,0 @@ ===================

@@ -348,2 +348,10 @@

removeCycles() {
debug('removing cycles from tree');
for (let cycle of this.graph.cycles()) {
this.removeDependency(cycle[1], cycle[0]);
}
debug('done removing cycles from tree');
}
/**

@@ -350,0 +358,0 @@ * Returns a trimmed object that can be serialized as JSON. It includes a list

4

package.json
{
"name": "mako-tree",
"version": "0.10.1",
"version": "0.11.0",
"main": "./lib/tree",

@@ -11,3 +11,3 @@ "description": "The build tree structure used internally by mako",

"file-extension": "^2.0.1",
"graph-toposort": "^0.1.1",
"graph-toposort": "^0.2.0",
"graph.js": "^1.20.1",

@@ -14,0 +14,0 @@ "regex-iso-date": "^1.0.0"

@@ -612,2 +612,57 @@

describe('#removeCycles()', function () {
it('should remove shallow cycles', function () {
// a <- b <- c*
// <- c <- b*
let tree = new Tree();
tree.addFile('a', true);
tree.addFile('b');
tree.addFile('c');
tree.addDependency('a', 'b');
tree.addDependency('a', 'c');
tree.addDependency('b', 'c');
tree.addDependency('c', 'b');
tree.removeCycles();
assert.deepEqual(tree.getFiles({ topological: true }), [ 'c', 'b', 'a' ]);
});
it('should remove cycles found deeper in the graph', function () {
// a <- b <- c <- d*
// <- d <- c*
let tree = new Tree();
tree.addFile('a', true);
tree.addFile('b');
tree.addFile('c');
tree.addFile('d');
tree.addDependency('a', 'b');
tree.addDependency('b', 'c');
tree.addDependency('b', 'd');
tree.addDependency('c', 'd');
tree.addDependency('d', 'c');
tree.removeCycles();
assert.deepEqual(tree.getFiles({ topological: true }), [ 'd', 'c', 'b', 'a' ]);
});
it('should remove large cycles in the graph', function () {
// a <- b <- c <- d <- b*
let tree = new Tree();
tree.addFile('a', true);
tree.addFile('b');
tree.addFile('c');
tree.addFile('d');
tree.addDependency('a', 'b');
tree.addDependency('b', 'c');
tree.addDependency('c', 'd');
tree.addDependency('d', 'b');
tree.removeCycles();
assert.deepEqual(tree.getFiles({ topological: true }), [ 'd', 'c', 'b', 'a' ]);
});
});
describe('#toJSON()', function () {

@@ -614,0 +669,0 @@ it('should return a list of vertices and edges for reconstructing the graph', function () {

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