Comparing version
@@ -5,3 +5,3 @@ # How to contribute | ||
## Logging Issues | ||
All issues should be created using the [new issue form](https://github.com/spumko/topo/issues/new). Clearly describe the issue including steps | ||
All issues should be created using the [new issue form](https://github.com/hapijs/topo/issues/new). Clearly describe the issue including steps | ||
to reproduce if there are any. Also, make sure to indicate the earliest version that has the issue being reported. | ||
@@ -14,5 +14,5 @@ | ||
* Fork the repository on GitHub. | ||
* Fix the issue ensuring that your code follows the [style guide](https://github.com/spumko/hapi/blob/master/docs/Style.md). | ||
* Fix the issue ensuring that your code follows the [style guide](https://github.com/hapijs/hapi/blob/master/docs/Style.md). | ||
* Add tests for your new code ensuring that you have 100% code coverage (we can help you reach 100% but will not merge without it). | ||
* Run `npm test` to generate a report of test coverage | ||
* [Pull requests](http://help.github.com/send-pull-requests/) should be made to the [master branch](https://github.com/spumko/topo/tree/master). | ||
* [Pull requests](http://help.github.com/send-pull-requests/) should be made to the [master branch](https://github.com/hapijs/topo/tree/master). |
@@ -89,7 +89,10 @@ // Load modules | ||
Object.keys(graph).forEach(function (node) { | ||
var graphNodes = Object.keys(graph); | ||
for (i = 0, il = graphNodes.length; i < il; ++i) { | ||
var node = graphNodes[i]; | ||
var expandedGroups = []; | ||
var expandedGroups = []; | ||
for (var groupIndex in graph[node]) { | ||
var group = graph[node][groupIndex]; | ||
var graphNodeItems = Object.keys(graph[node]); | ||
for (j = 0, jl = graphNodeItems.length; j < jl; ++j) { | ||
var group = graph[node][graphNodeItems[j]]; | ||
groups[group] = groups[group] || []; | ||
@@ -102,3 +105,3 @@ groups[group].forEach(function (d) { | ||
graph[node] = expandedGroups; | ||
}); | ||
} | ||
@@ -108,8 +111,10 @@ // Merge intermediary graph using graphAfters into final graph | ||
var afterNodes = Object.keys(graphAfters); | ||
for (var n in afterNodes) { | ||
var group = afterNodes[n]; | ||
for (i = 0, il = afterNodes.length; i < il; ++i) { | ||
var group = afterNodes[i]; | ||
for (var itemIndex in groups[group]) { | ||
var node = groups[group][itemIndex]; | ||
graph[node] = graph[node].concat(graphAfters[group]); | ||
if (groups[group]) { | ||
for (j = 0, jl = groups[group].length; j < jl; ++j) { | ||
var node = groups[group][j]; | ||
graph[node] = graph[node].concat(graphAfters[group]); | ||
} | ||
} | ||
@@ -121,8 +126,8 @@ } | ||
var ancestors = {}; | ||
var graphNodes = Object.keys(graph); | ||
for (var i in graphNodes) { | ||
graphNodes = Object.keys(graph); | ||
for (i = 0, il = graphNodes.length; i < il; ++i) { | ||
var node = graphNodes[i]; | ||
var children = graph[node]; | ||
for (var j = 0, jl = children.length; j < jl; ++j) { | ||
for (j = 0, jl = children.length; j < jl; ++j) { | ||
ancestors[children[j]] = (ancestors[children[j]] || []).concat(node); | ||
@@ -137,3 +142,3 @@ } | ||
for (var i = 0, il = this._items.length; i < il; ++i) { | ||
for (i = 0, il = this._items.length; i < il; ++i) { | ||
var next = i; | ||
@@ -143,3 +148,3 @@ | ||
next = null; | ||
for (var j = 0, jl = this._items.length; j < jl; ++j) { | ||
for (j = 0, jl = this._items.length; j < jl; ++j) { | ||
if (visited[j] === true) { | ||
@@ -146,0 +151,0 @@ continue; |
{ | ||
"name": "topo", | ||
"description": "Topological sorting with grouping support", | ||
"version": "1.0.0", | ||
"repository": "git://github.com/spumko/topo", | ||
"version": "1.0.1", | ||
"repository": "git://github.com/hapijs/topo", | ||
"main": "index", | ||
@@ -14,3 +14,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=0.10.22" | ||
"node": ">=0.10.30" | ||
}, | ||
@@ -29,5 +29,5 @@ "dependencies": { | ||
"type": "BSD", | ||
"url": "http://github.com/spumko/topo/raw/master/LICENSE" | ||
"url": "http://github.com/hapijs/topo/raw/master/LICENSE" | ||
} | ||
] | ||
} |
@@ -1,2 +0,1 @@ | ||
<a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a> | ||
#topo | ||
@@ -6,3 +5,4 @@ | ||
[](http://travis-ci.org/spumko/topo) | ||
[](http://travis-ci.org/hapijs/topo) | ||
Lead Maintainer: [Eran Hammer](https://github.com/hueniverse) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
11908
3.52%223
2.29%