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 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 = cloneWithoutLinks(cpNode);
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
- let newNode = nodeMap.get(node);
6813
- if (!newNode) {
6814
- newNode = cloneWithoutLinks(node);
6815
- nodeMap.set(node, newNode);
6816
- cpStack.push({ cpNode: node, newCpNode: newNode });
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] = newNode;
6821
+ newCpNode[edge] = node_;
6819
6822
  }
6820
6823
  }
6821
6824
  return newCpNode;
6822
6825
  }
6823
- function cloneWithoutLinks(cpNode) {
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;