@atlaspack/graph 3.2.1-dev.3401 → 3.2.1-dev.3443
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ContentGraph.js +2 -2
- package/lib/Graph.js +2 -2
- package/package.json +4 -4
- package/src/ContentGraph.js +2 -2
- package/src/Graph.js +2 -2
package/lib/ContentGraph.js
CHANGED
|
@@ -69,12 +69,12 @@ class ContentGraph extends _Graph.default {
|
|
|
69
69
|
hasContentKey(contentKey) {
|
|
70
70
|
return this._contentKeyToNodeId.has(contentKey);
|
|
71
71
|
}
|
|
72
|
-
removeNode(nodeId) {
|
|
72
|
+
removeNode(nodeId, removeOrphans = true) {
|
|
73
73
|
this._assertHasNodeId(nodeId);
|
|
74
74
|
let contentKey = (0, _nullthrows().default)(this._nodeIdToContentKey.get(nodeId));
|
|
75
75
|
this._contentKeyToNodeId.delete(contentKey);
|
|
76
76
|
this._nodeIdToContentKey.delete(nodeId);
|
|
77
|
-
super.removeNode(nodeId);
|
|
77
|
+
super.removeNode(nodeId, removeOrphans);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
exports.default = ContentGraph;
|
package/lib/Graph.js
CHANGED
|
@@ -92,7 +92,7 @@ class Graph {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// Removes node and any edges coming from or to that node
|
|
95
|
-
removeNode(nodeId) {
|
|
95
|
+
removeNode(nodeId, removeOrphans = true) {
|
|
96
96
|
if (!this.hasNode(nodeId)) {
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
@@ -109,7 +109,7 @@ class Graph {
|
|
|
109
109
|
type,
|
|
110
110
|
to
|
|
111
111
|
} of this.adjacencyList.getOutboundEdgesByType(nodeId)) {
|
|
112
|
-
this._removeEdge(nodeId, to, type);
|
|
112
|
+
this._removeEdge(nodeId, to, type, removeOrphans);
|
|
113
113
|
}
|
|
114
114
|
this.nodes[nodeId] = null;
|
|
115
115
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/graph",
|
|
3
|
-
"version": "3.2.1-dev.
|
|
3
|
+
"version": "3.2.1-dev.3443+d1170cfc7",
|
|
4
4
|
"description": "Blazing fast, zero configuration web application bundler",
|
|
5
|
-
"license": "MIT",
|
|
5
|
+
"license": "(MIT OR Apache-2.0)",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"node": ">= 16.0.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@atlaspack/feature-flags": "2.12.1-dev.
|
|
19
|
+
"@atlaspack/feature-flags": "2.12.1-dev.3443+d1170cfc7",
|
|
20
20
|
"nullthrows": "^1.1.1"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "d1170cfc79beb290b2a066f472f68f71f7d7cb23"
|
|
23
23
|
}
|
package/src/ContentGraph.js
CHANGED
|
@@ -86,11 +86,11 @@ export default class ContentGraph<TNode, TEdgeType: number = 1> extends Graph<
|
|
|
86
86
|
return this._contentKeyToNodeId.has(contentKey);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
removeNode(nodeId: NodeId): void {
|
|
89
|
+
removeNode(nodeId: NodeId, removeOrphans: boolean = true): void {
|
|
90
90
|
this._assertHasNodeId(nodeId);
|
|
91
91
|
let contentKey = nullthrows(this._nodeIdToContentKey.get(nodeId));
|
|
92
92
|
this._contentKeyToNodeId.delete(contentKey);
|
|
93
93
|
this._nodeIdToContentKey.delete(nodeId);
|
|
94
|
-
super.removeNode(nodeId);
|
|
94
|
+
super.removeNode(nodeId, removeOrphans);
|
|
95
95
|
}
|
|
96
96
|
}
|
package/src/Graph.js
CHANGED
|
@@ -186,7 +186,7 @@ export default class Graph<TNode, TEdgeType: number = 1> {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
// Removes node and any edges coming from or to that node
|
|
189
|
-
removeNode(nodeId: NodeId) {
|
|
189
|
+
removeNode(nodeId: NodeId, removeOrphans: boolean = true) {
|
|
190
190
|
if (!this.hasNode(nodeId)) {
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
@@ -203,7 +203,7 @@ export default class Graph<TNode, TEdgeType: number = 1> {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
for (let {type, to} of this.adjacencyList.getOutboundEdgesByType(nodeId)) {
|
|
206
|
-
this._removeEdge(nodeId, to, type);
|
|
206
|
+
this._removeEdge(nodeId, to, type, removeOrphans);
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
this.nodes[nodeId] = null;
|