@parcel/graph
Advanced tools
Comparing version 2.0.2-nightly.2569 to 2.0.2-nightly.2571
@@ -68,2 +68,6 @@ "use strict"; | ||
addNodeByContentKeyIfNeeded(contentKey, node) { | ||
return this.hasContentKey(contentKey) ? this.getNodeIdByContentKey(contentKey) : this.addNodeByContentKey(contentKey, node); | ||
} | ||
getNodeByContentKey(contentKey) { | ||
@@ -70,0 +74,0 @@ let nodeId = this._contentKeyToNodeId.get(contentKey); |
@@ -341,2 +341,12 @@ "use strict"; | ||
topoSort() { | ||
let sorted = []; | ||
this.traverse({ | ||
exit: nodeId => { | ||
sorted.push(nodeId); | ||
} | ||
}); | ||
return sorted.reverse(); | ||
} | ||
findAncestor(nodeId, fn) { | ||
@@ -343,0 +353,0 @@ let res = null; |
{ | ||
"name": "@parcel/graph", | ||
"version": "2.0.2-nightly.2569+68ceb558", | ||
"version": "2.0.2-nightly.2571+588bf4c0", | ||
"description": "Blazing fast, zero configuration web application bundler", | ||
@@ -25,3 +25,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "68ceb5581497cb336e82002fafcec53fb6cfc084" | ||
"gitHead": "588bf4c0d6d9dac65a9bf89bf734d7684b523ca2" | ||
} |
@@ -65,2 +65,8 @@ // @flow strict-local | ||
addNodeByContentKeyIfNeeded(contentKey: ContentKey, node: TNode): NodeId { | ||
return this.hasContentKey(contentKey) | ||
? this.getNodeIdByContentKey(contentKey) | ||
: this.addNodeByContentKey(contentKey, node); | ||
} | ||
getNodeByContentKey(contentKey: ContentKey): ?TNode { | ||
@@ -67,0 +73,0 @@ let nodeId = this._contentKeyToNodeId.get(contentKey); |
@@ -406,2 +406,12 @@ // @flow strict-local | ||
topoSort(): Array<NodeId> { | ||
let sorted: Array<NodeId> = []; | ||
this.traverse({ | ||
exit: nodeId => { | ||
sorted.push(nodeId); | ||
}, | ||
}); | ||
return sorted.reverse(); | ||
} | ||
findAncestor(nodeId: NodeId, fn: (nodeId: NodeId) => boolean): ?NodeId { | ||
@@ -408,0 +418,0 @@ let res = null; |
@@ -86,7 +86,10 @@ // @flow strict-local | ||
let graph = new Graph(); | ||
let rootNode = graph.addNode('root'); | ||
graph.setRootNodeId(rootNode); | ||
let nodeA = graph.addNode('a'); | ||
let nodeB = graph.addNode('b'); | ||
let nodeC = graph.addNode('c'); | ||
graph.addEdge(nodeA, nodeB); | ||
graph.addEdge(nodeA, nodeC, 1); | ||
graph.addEdge(rootNode, nodeB); | ||
graph.addEdge(nodeB, nodeC, 1); | ||
assert(graph.isOrphanedNode(nodeA)); | ||
@@ -105,2 +108,3 @@ assert(!graph.isOrphanedNode(nodeB)); | ||
let nodeA = graph.addNode('a'); | ||
graph.setRootNodeId(nodeA); | ||
let nodeB = graph.addNode('b'); | ||
@@ -145,2 +149,3 @@ let nodeC = graph.addNode('c'); | ||
let nodeA = graph.addNode('a'); | ||
graph.setRootNodeId(nodeA); | ||
let nodeB = graph.addNode('b'); | ||
@@ -274,2 +279,3 @@ let nodeC = graph.addNode('c'); | ||
let nodeA = graph.addNode('a'); | ||
graph.setRootNodeId(nodeA); | ||
let nodeB = graph.addNode('b'); | ||
@@ -276,0 +282,0 @@ let nodeC = graph.addNode('c'); |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
128152
3611