flo-mat 3.0.13 → 3.0.14
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/browser/index.js +14 -10
- package/browser/index.min.js +1 -1
- package/node/cp-node/fs/clone.d.ts +1 -1
- package/node/cp-node/fs/clone.js +14 -10
- package/node/cp-node/fs/clone.js.map +1 -1
- package/node/cp-node/fs/get-all-on-loop.js.map +1 -1
- package/package.json +1 -1
- package/src/cp-node/fs/clone.ts +20 -14
- package/src/cp-node/fs/get-all-on-loop.ts +1 -1
package/browser/index.js
CHANGED
|
@@ -6792,7 +6792,7 @@ function traverseVertices(cpStart, traverseVerticesCallback) {
|
|
|
6792
6792
|
|
|
6793
6793
|
;// ./src/cp-node/fs/clone.ts
|
|
6794
6794
|
/** @internal */
|
|
6795
|
-
const EDGES = ['prev', 'next', 'prevOnCircle', 'nextOnCircle'];
|
|
6795
|
+
const EDGES = ['prev', 'next', 'prevOnCircle', 'nextOnCircle', 'holeCloserTwin'];
|
|
6796
6796
|
/**
|
|
6797
6797
|
* Returns a deep clone of this `CpNode`. Can be used to copy the MAT
|
|
6798
6798
|
* since cloning a single `CpNode` necessarily implies cloning all
|
|
@@ -6802,32 +6802,36 @@ function clone(cpNode) {
|
|
|
6802
6802
|
// Don't change this function to be recursive, the call stack may
|
|
6803
6803
|
// overflow if there are too many CpNodes.
|
|
6804
6804
|
const nodeMap = new Map();
|
|
6805
|
-
const newCpNode =
|
|
6805
|
+
const newCpNode = cloneWithoutEdges(cpNode);
|
|
6806
6806
|
nodeMap.set(cpNode, newCpNode);
|
|
6807
6807
|
const cpStack = [{ cpNode, newCpNode }];
|
|
6808
6808
|
while (cpStack.length) {
|
|
6809
6809
|
const { cpNode, newCpNode } = cpStack.pop();
|
|
6810
6810
|
for (const edge of EDGES) {
|
|
6811
6811
|
const node = cpNode[edge];
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6812
|
+
if (node === undefined) {
|
|
6813
|
+
continue;
|
|
6814
|
+
}
|
|
6815
|
+
let node_ = nodeMap.get(node);
|
|
6816
|
+
if (!node_) {
|
|
6817
|
+
node_ = cloneWithoutEdges(node);
|
|
6818
|
+
nodeMap.set(node, node_);
|
|
6819
|
+
cpStack.push({ cpNode: node, newCpNode: node_ });
|
|
6817
6820
|
}
|
|
6818
|
-
newCpNode[edge] =
|
|
6821
|
+
newCpNode[edge] = node_;
|
|
6819
6822
|
}
|
|
6820
6823
|
}
|
|
6821
6824
|
return newCpNode;
|
|
6822
6825
|
}
|
|
6823
|
-
function
|
|
6826
|
+
function cloneWithoutEdges(cpNode) {
|
|
6824
6827
|
const newNode = {
|
|
6825
6828
|
...cpNode,
|
|
6826
6829
|
...{
|
|
6827
6830
|
prev: undefined,
|
|
6828
6831
|
next: undefined,
|
|
6829
6832
|
prevOnCircle: undefined,
|
|
6830
|
-
nextOnCircle: undefined
|
|
6833
|
+
nextOnCircle: undefined,
|
|
6834
|
+
holeCloserTwin: undefined
|
|
6831
6835
|
}
|
|
6832
6836
|
};
|
|
6833
6837
|
return newNode;
|