flo-mat 3.0.3 → 3.0.5

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/d.bat ADDED
@@ -0,0 +1,4 @@
1
+ cd node_modules || exit /b
2
+ del /f/q/s *.* > nul
3
+ cd..
4
+ rmdir /q/s node_modules
package/newdocs/d.bat ADDED
@@ -0,0 +1,4 @@
1
+ cd node_modules || exit /b
2
+ del /f/q/s *.* > nul
3
+ cd..
4
+ rmdir /q/s node_modules
@@ -1,2 +1,14 @@
1
- declare const totalCurvature$: (a: number[][]) => number;
1
+ import { totalCurvature } from "flo-bezier3";
2
+ declare const totalCurvature$: typeof totalCurvature & {
3
+ readonly weakMapS: WeakMap<object, {
4
+ readonly weakMap: WeakMap<object, any>;
5
+ readonly map: Map<object, any>;
6
+ }>;
7
+ readonly mapS: Map<object, {
8
+ readonly weakMap: WeakMap<object, any>;
9
+ readonly map: Map<object, any>;
10
+ }>;
11
+ readonly clearCache: () => void;
12
+ readonly addToCache: (r: unknown, ...args: any) => void;
13
+ };
2
14
  export { totalCurvature$ };
@@ -1,2 +1,14 @@
1
- declare const totalLength$: (a: number[][]) => number;
1
+ import { totalLength } from "flo-bezier3";
2
+ declare const totalLength$: typeof totalLength & {
3
+ readonly weakMapS: WeakMap<object, {
4
+ readonly weakMap: WeakMap<object, any>;
5
+ readonly map: Map<object, any>;
6
+ }>;
7
+ readonly mapS: Map<object, {
8
+ readonly weakMap: WeakMap<object, any>;
9
+ readonly map: Map<object, any>;
10
+ }>;
11
+ readonly clearCache: () => void;
12
+ readonly addToCache: (r: unknown, ...args: any) => void;
13
+ };
2
14
  export { totalLength$ };
@@ -218,7 +218,18 @@ declare const CpNodeFs: {
218
218
  getMatCurvesBetween: typeof getMatCurvesBetween;
219
219
  getHoleClosers: typeof getHoleClosers;
220
220
  getSpeed: typeof getSpeed;
221
- getSmoothedSpeed$: (a: number) => (a: CpNode) => number | undefined;
221
+ getSmoothedSpeed$: (a: number) => ((cpNode: CpNode) => number | undefined) & {
222
+ readonly weakMapS: WeakMap<object, {
223
+ readonly weakMap: WeakMap<object, any>;
224
+ readonly map: Map<object, any>;
225
+ }>;
226
+ readonly mapS: Map<object, {
227
+ readonly weakMap: WeakMap<object, any>;
228
+ readonly map: Map<object, any>;
229
+ }>;
230
+ readonly clearCache: () => void;
231
+ readonly addToCache: (r: unknown, ...args: any) => void;
232
+ };
222
233
  getInitialDegAngleBetweenMatCurves: typeof getInitialDegAngleBetweenMatCurves;
223
234
  getAllVertices: typeof getAllVertices;
224
235
  };
@@ -1,4 +1,15 @@
1
1
  import { CpNode } from "../cp-node.js";
2
2
  declare function getMatDistanceToNext(cpNode: CpNode): number;
3
- declare const getMatDistanceToNext$: (a: CpNode) => number;
3
+ declare const getMatDistanceToNext$: typeof getMatDistanceToNext & {
4
+ readonly weakMapS: WeakMap<object, {
5
+ readonly weakMap: WeakMap<object, any>;
6
+ readonly map: Map<object, any>;
7
+ }>;
8
+ readonly mapS: Map<object, {
9
+ readonly weakMap: WeakMap<object, any>;
10
+ readonly map: Map<object, any>;
11
+ }>;
12
+ readonly clearCache: () => void;
13
+ readonly addToCache: (r: unknown, ...args: any) => void;
14
+ };
4
15
  export { getMatDistanceToNext, getMatDistanceToNext$ };
@@ -1,4 +1,15 @@
1
1
  import { CpNode } from '../cp-node.js';
2
2
  declare function getMatCurveToNext(cpNode: CpNode): number[][];
3
- declare const getMatCurveToNext$: (a: CpNode) => number[][];
3
+ declare const getMatCurveToNext$: typeof getMatCurveToNext & {
4
+ readonly weakMapS: WeakMap<object, {
5
+ readonly weakMap: WeakMap<object, any>;
6
+ readonly map: Map<object, any>;
7
+ }>;
8
+ readonly mapS: Map<object, {
9
+ readonly weakMap: WeakMap<object, any>;
10
+ readonly map: Map<object, any>;
11
+ }>;
12
+ readonly clearCache: () => void;
13
+ readonly addToCache: (r: unknown, ...args: any) => void;
14
+ };
4
15
  export { getMatCurveToNext, getMatCurveToNext$ };
@@ -1,3 +1,14 @@
1
1
  import { CpNode } from "../cp-node.js";
2
- declare const getSmoothedSpeed$: (a: number) => (a: CpNode) => number | undefined;
2
+ declare const getSmoothedSpeed$: (a: number) => ((cpNode: CpNode) => number | undefined) & {
3
+ readonly weakMapS: WeakMap<object, {
4
+ readonly weakMap: WeakMap<object, any>;
5
+ readonly map: Map<object, any>;
6
+ }>;
7
+ readonly mapS: Map<object, {
8
+ readonly weakMap: WeakMap<object, any>;
9
+ readonly map: Map<object, any>;
10
+ }>;
11
+ readonly clearCache: () => void;
12
+ readonly addToCache: (r: unknown, ...args: any) => void;
13
+ };
3
14
  export { getSmoothedSpeed$ };
@@ -1,4 +1,15 @@
1
1
  import { CpNode } from "../cp-node.js";
2
- declare const getSpeed$: (a: CpNode) => number | undefined;
2
+ declare const getSpeed$: typeof getSpeed & {
3
+ readonly weakMapS: WeakMap<object, {
4
+ readonly weakMap: WeakMap<object, any>;
5
+ readonly map: Map<object, any>;
6
+ }>;
7
+ readonly mapS: Map<object, {
8
+ readonly weakMap: WeakMap<object, any>;
9
+ readonly map: Map<object, any>;
10
+ }>;
11
+ readonly clearCache: () => void;
12
+ readonly addToCache: (r: unknown, ...args: any) => void;
13
+ };
3
14
  declare function getSpeed(cpNode: CpNode): number | undefined;
4
15
  export { getSpeed, getSpeed$ };
@@ -1,5 +1,3 @@
1
1
  import { CpNode } from '../cp-node.js';
2
- declare function traverseEdges$$(cpNode: CpNode, traverseEdgesCallback: (cpNode: CpNode) => Promise<void>): Promise<void>;
3
2
  declare function traverseEdges(cpNode: CpNode, traverseEdgesCallback: (cpNode: CpNode) => void): void;
4
- declare function $traverseEdges(cpNode: CpNode): Generator<CpNode, void, unknown>;
5
- export { traverseEdges, $traverseEdges, traverseEdges$$ };
3
+ export { traverseEdges };
@@ -1,28 +1,5 @@
1
1
  import { isTerminating } from './is-terminating.js';
2
2
  import { getAllOnLoop } from './get-all-on-loop.js';
3
- // function traverseEdges2(
4
- // cpNode: CpNode,
5
- // traverseEdgesCallback: (cpNode: CpNode) => void) {
6
- // // Since the tree is unrooted we must iterate in all directions from the
7
- // // given vertex.
8
- // const cps = getAllOnCircle(cpNode);
9
- // while (cps.length) {
10
- // const cp = cps.pop()!;
11
- // traverseEdgesCallback(cp);
12
- // if (isTerminating(cp)) { continue; }
13
- // cps.push(...getChildren(cp));
14
- // }
15
- // }
16
- async function traverseEdges$$(cpNode, traverseEdgesCallback) {
17
- const cpNodes = getAllOnLoop(cpNode);
18
- const seen = new Set();
19
- for (cpNode of cpNodes) {
20
- if (!isTerminating(cpNode) && !seen.has(cpNode.next.prevOnCircle)) {
21
- await traverseEdgesCallback(cpNode);
22
- }
23
- seen.add(cpNode);
24
- }
25
- }
26
3
  function traverseEdges(cpNode, traverseEdgesCallback) {
27
4
  const cpNodes = getAllOnLoop(cpNode);
28
5
  const seen = new Set();
@@ -33,15 +10,5 @@ function traverseEdges(cpNode, traverseEdgesCallback) {
33
10
  seen.add(cpNode);
34
11
  }
35
12
  }
36
- function* $traverseEdges(cpNode) {
37
- const cpNodes = getAllOnLoop(cpNode);
38
- const seen = new Set();
39
- for (cpNode of cpNodes) {
40
- if (!isTerminating(cpNode) && !seen.has(cpNode.next.prevOnCircle)) {
41
- yield cpNode;
42
- }
43
- seen.add(cpNode);
44
- }
45
- }
46
- export { traverseEdges, $traverseEdges, traverseEdges$$ };
13
+ export { traverseEdges };
47
14
  //# sourceMappingURL=traverse-edges.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-edges.js","sourceRoot":"","sources":["../../../src/cp-node/fs/traverse-edges.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,2BAA2B;AAC3B,oBAAoB;AACpB,uDAAuD;AAEvD,4EAA4E;AAC5E,oBAAoB;AACpB,uCAAuC;AAEvC,wBAAwB;AACxB,2BAA2B;AAC3B,+BAA+B;AAE/B,yCAAy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EAAE,CAAC;YACnE,MAAM,MAAM,CAAC;QACd,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;AACF,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"traverse-edges.js","sourceRoot":"","sources":["../../../src/cp-node/fs/traverse-edges.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,SAAS,aAAa,CACpB,MAAc,EACd,qBAA+C;IAEhD,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,KAAK,MAAM,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YACnE,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;AACF,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -8,7 +8,7 @@ const altClasses = [
8
8
  'thin10 red nofill'
9
9
  ];
10
10
  /** @internal */
11
- /*async */ function drawMat(g, mat, classes_, delay = 0, scaleFactor = 1) {
11
+ function drawMat(g, mat, classes_, delay = 0, scaleFactor = 1) {
12
12
  let cpNode = mat.cpNode;
13
13
  if (!cpNode) {
14
14
  return [];
@@ -18,8 +18,7 @@ const altClasses = [
18
18
  }
19
19
  const $svgs = [];
20
20
  let i = 0;
21
- traverseEdges(cpNode, async (cpNode) => {
22
- // await sleep(50);
21
+ traverseEdges(cpNode, cpNode => {
23
22
  if (isTerminating(cpNode)) {
24
23
  return;
25
24
  }
@@ -32,7 +31,5 @@ const altClasses = [
32
31
  });
33
32
  return $svgs;
34
33
  }
35
- function drawCurve() {
36
- }
37
34
  export { drawMat };
38
35
  //# sourceMappingURL=draw-mat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"draw-mat.js","sourceRoot":"","sources":["../../../../src/debug/functions/draw-elem/draw-mat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAkB,aAAa,EAAmB,MAAM,uCAAuC,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI1D,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;AAGnC,MAAM,UAAU,GAAG;IACf,oBAAoB;IACpB,mBAAmB;CACtB,CAAC;AAEF,gBAAgB;AAChB,UAAU,CAAA,SAAS,OAAO,CAClB,CAAc,EACd,GAAQ,EACR,QAAiB,EACjB,KAAK,GAAG,CAAC,EACT,WAAW,GAAG,CAAC;IAEnB,IAAI,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IACxB,IAAI,CAAC,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,CAAC;IAAC,CAAC;IAE3B,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IAAC,CAAC;IAExD,MAAM,KAAK,GAAiB,EAAE,CAAC;IAE/B,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,aAAa,CAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACjC,mBAAmB;QACnB,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QAEtC,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,EAAE,C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AAM,CAAC,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QAEtC,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QAExB,KAAK,CAAC,IAAI,CAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,GAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACjE,CAAC,EAAE,CAAC;IACR,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACjB,CAAC;AAGD,OAAO,EAAE,OAAO,EAAE,CAAA"}
@@ -1,2 +1,14 @@
1
- declare const getBoundingBox$: (a: number[][]) => number[][];
1
+ import { getBoundingBox } from "flo-bezier3";
2
+ declare const getBoundingBox$: typeof getBoundingBox & {
3
+ readonly weakMapS: WeakMap<object, {
4
+ readonly weakMap: WeakMap<object, any>;
5
+ readonly map: Map<object, any>;
6
+ }>;
7
+ readonly mapS: Map<object, {
8
+ readonly weakMap: WeakMap<object, any>;
9
+ readonly map: Map<object, any>;
10
+ }>;
11
+ readonly clearCache: () => void;
12
+ readonly addToCache: (r: unknown, ...args: any) => void;
13
+ };
2
14
  export { getBoundingBox$ };
@@ -2,5 +2,16 @@ import { PointOnShape } from "./point-on-shape.js";
2
2
  /**
3
3
  * @internal
4
4
  */
5
- declare const isPosQuiteSharpCorner: (a: PointOnShape) => boolean;
5
+ declare const isPosQuiteSharpCorner: ((pos: PointOnShape) => boolean) & {
6
+ readonly weakMapS: WeakMap<object, {
7
+ readonly weakMap: WeakMap<object, any>;
8
+ readonly map: Map<object, any>;
9
+ }>;
10
+ readonly mapS: Map<object, {
11
+ readonly weakMap: WeakMap<object, any>;
12
+ readonly map: Map<object, any>;
13
+ }>;
14
+ readonly clearCache: () => void;
15
+ readonly addToCache: (r: unknown, ...args: any) => void;
16
+ };
6
17
  export { isPosQuiteSharpCorner };
@@ -2,5 +2,16 @@ import { PointOnShape } from "./point-on-shape.js";
2
2
  /**
3
3
  * @internal
4
4
  */
5
- declare const isPosSharpCorner: (a: PointOnShape) => boolean;
5
+ declare const isPosSharpCorner: ((pos: PointOnShape) => boolean) & {
6
+ readonly weakMapS: WeakMap<object, {
7
+ readonly weakMap: WeakMap<object, any>;
8
+ readonly map: Map<object, any>;
9
+ }>;
10
+ readonly mapS: Map<object, {
11
+ readonly weakMap: WeakMap<object, any>;
12
+ readonly map: Map<object, any>;
13
+ }>;
14
+ readonly clearCache: () => void;
15
+ readonly addToCache: (r: unknown, ...args: any) => void;
16
+ };
6
17
  export { isPosSharpCorner };
@@ -3,10 +3,21 @@ import { PointOnShape } from '../point-on-shape/point-on-shape.js';
3
3
  /**
4
4
  * @internal
5
5
  */
6
- declare const getLoopBounds: (a: Loop) => {
6
+ declare const getLoopBounds: ((loop: Loop) => {
7
7
  minX: PointOnShape;
8
8
  minY: PointOnShape;
9
9
  maxX: PointOnShape;
10
10
  maxY: PointOnShape;
11
+ }) & {
12
+ readonly weakMapS: WeakMap<object, {
13
+ readonly weakMap: WeakMap<object, any>;
14
+ readonly map: Map<object, any>;
15
+ }>;
16
+ readonly mapS: Map<object, {
17
+ readonly weakMap: WeakMap<object, any>;
18
+ readonly map: Map<object, any>;
19
+ }>;
20
+ readonly clearCache: () => void;
21
+ readonly addToCache: (r: unknown, ...args: any) => void;
11
22
  };
12
23
  export { getLoopBounds };
@@ -1,10 +1,21 @@
1
1
  import { Loop } from 'flo-boolean';
2
2
  import { PointOnShape } from '../point-on-shape/point-on-shape.js';
3
3
  /** @internal */
4
- declare const getShapeBounds: (a: Loop[]) => {
4
+ declare const getShapeBounds: ((loops: Loop[]) => {
5
5
  minX: PointOnShape;
6
6
  minY: PointOnShape;
7
7
  maxX: PointOnShape;
8
8
  maxY: PointOnShape;
9
+ }) & {
10
+ readonly weakMapS: WeakMap<object, {
11
+ readonly weakMap: WeakMap<object, any>;
12
+ readonly map: Map<object, any>;
13
+ }>;
14
+ readonly mapS: Map<object, {
15
+ readonly weakMap: WeakMap<object, any>;
16
+ readonly map: Map<object, any>;
17
+ }>;
18
+ readonly clearCache: () => void;
19
+ readonly addToCache: (r: unknown, ...args: any) => void;
9
20
  };
10
21
  export { getShapeBounds };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "flo-mat",
3
3
  "sideEffects": false,
4
4
  "description": "Medial / Scale Axis Transform (MAT/SAT) Library.",
5
- "version": "3.0.3",
5
+ "version": "3.0.5",
6
6
  "author": {
7
7
  "name": "Floris Steenkamp"
8
8
  },
@@ -31,38 +31,37 @@
31
31
  "skeleton"
32
32
  ],
33
33
  "dependencies": {
34
- "big-float-ts": "^4.0.1",
35
- "double-double": "^3.0.2",
36
- "flo-bezier3": "^6.0.2",
37
- "flo-boolean": "^4.0.2",
38
- "flo-draw": "^2.0.4",
39
- "flo-gauss-quadrature": "^2.1.3",
40
- "flo-ll-rb-tree": "^0.3.3",
41
- "flo-memoize": "^1.1.1",
42
- "flo-poly": "^7.0.1",
43
- "flo-vector2d": "^4.0.5"
34
+ "big-float-ts": "^4.0.2",
35
+ "double-double": "^3.0.4",
36
+ "flo-bezier3": "^6.0.7",
37
+ "flo-boolean": "^5.0.1",
38
+ "flo-draw": "^2.0.5",
39
+ "flo-gauss-quadrature": "^2.1.4",
40
+ "flo-ll-rb-tree": "^0.3.4",
41
+ "flo-memoize": "^2.0.1",
42
+ "flo-poly": "^7.0.2",
43
+ "flo-vector2d": "^4.0.6"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/chai": "^5.2.3",
47
47
  "@types/mocha": "^10.0.10",
48
- "@types/node": "^24.10.1",
49
- "c8": "^10.1.3",
50
- "chai": "^6.2.1",
48
+ "@types/node": "^25.6.0",
49
+ "c8": "^11.0.0",
50
+ "chai": "^6.2.2",
51
51
  "circular-dependency-plugin": "^5.2.2",
52
52
  "mocha": "^11.7.5",
53
- "resolve-typescript-plugin": "^2.0.1",
54
- "rimraf": "^6.1.2",
53
+ "rimraf": "^6.1.3",
55
54
  "source-map-support": "^0.5.21",
56
- "ts-loader": "^9.5.4",
55
+ "ts-loader": "^9.5.7",
57
56
  "ts-node": "^10.9.2",
58
- "typescript": "^5.9.3",
59
- "webpack": "^5.103.0",
60
- "webpack-cli": "^6.0.1"
57
+ "typescript": "^6.0.3",
58
+ "webpack": "^5.106.2",
59
+ "webpack-cli": "^7.0.2"
61
60
  },
62
61
  "scripts": {
63
62
  "build": "npm run build-browser && npm run build-node",
64
63
  "build-node": "rimraf node && tsc",
65
- "build-browser": "rimraf browser && webpack",
64
+ "build-browser": "rimraf browser && webpack --mode production",
66
65
  "test": "mocha",
67
66
  "coverage": "c8 mocha",
68
67
  "test-package": "npm pack"
@@ -1,44 +1,8 @@
1
1
  import { CpNode } from '../cp-node.js';
2
- import { getAllOnCircle } from './get-all-on-circle.js';
3
2
  import { isTerminating } from './is-terminating.js';
4
- import { getChildren } from './get-children.js';
5
3
  import { getAllOnLoop } from './get-all-on-loop.js';
6
4
 
7
5
 
8
- // function traverseEdges2(
9
- // cpNode: CpNode,
10
- // traverseEdgesCallback: (cpNode: CpNode) => void) {
11
-
12
- // // Since the tree is unrooted we must iterate in all directions from the
13
- // // given vertex.
14
- // const cps = getAllOnCircle(cpNode);
15
-
16
- // while (cps.length) {
17
- // const cp = cps.pop()!;
18
- // traverseEdgesCallback(cp);
19
-
20
- // if (isTerminating(cp)) { continue; }
21
- // cps.push(...getChildren(cp));
22
- // }
23
- // }
24
-
25
-
26
- async function traverseEdges$$(
27
- cpNode: CpNode,
28
- traverseEdgesCallback: (cpNode: CpNode) => Promise<void>) {
29
-
30
- const cpNodes = getAllOnLoop(cpNode);
31
- const seen = new Set<CpNode>();
32
-
33
- for (cpNode of cpNodes) {
34
- if (!isTerminating(cpNode) && !seen.has(cpNode.next.prevOnCircle)) {
35
- await traverseEdgesCallback(cpNode);
36
- }
37
- seen.add(cpNode);
38
- }
39
- }
40
-
41
-
42
6
  function traverseEdges(
43
7
  cpNode: CpNode,
44
8
  traverseEdgesCallback: (cpNode: CpNode) => void) {
@@ -55,17 +19,4 @@ function traverseEdges(
55
19
  }
56
20
 
57
21
 
58
- function* $traverseEdges(cpNode: CpNode) {
59
- const cpNodes = getAllOnLoop(cpNode);
60
- const seen = new Set<CpNode>();
61
-
62
- for (cpNode of cpNodes) {
63
- if (!isTerminating(cpNode) && !seen.has(cpNode.next.prevOnCircle)) {
64
- yield cpNode;
65
- }
66
- seen.add(cpNode);
67
- }
68
- }
69
-
70
-
71
- export { traverseEdges, $traverseEdges, traverseEdges$$ }
22
+ export { traverseEdges }
@@ -1,10 +1,9 @@
1
1
  import { drawFs } from 'flo-draw';
2
2
  import { Mat } from '../../../mat/mat.js';
3
- import { $traverseEdges, traverseEdges, traverseEdges$$ } from '../../../cp-node/fs/traverse-edges.js';
3
+ import { traverseEdges } from '../../../cp-node/fs/traverse-edges.js';
4
4
  import { getMatCurveToNext } from '../../../cp-node/fs/get-mat-curve-to-next.js';
5
5
  import { CpNodeFs } from '../../../cp-node/cp-node-fs.js';
6
- import { drawCpNode } from './draw-cp-node.js';
7
- import { sleep } from '../../../utils/sleep.js';
6
+
8
7
 
9
8
  const { isTerminating } = CpNodeFs;
10
9
 
@@ -15,12 +14,12 @@ const altClasses = [
15
14
  ];
16
15
 
17
16
  /** @internal */
18
- /*async */function drawMat(
17
+ function drawMat(
19
18
  g: SVGGElement,
20
19
  mat: Mat,
21
20
  classes_?: string,
22
21
  delay = 0,
23
- scaleFactor = 1): /*Promise<*/SVGElement[]/*>*/ {
22
+ scaleFactor = 1): SVGElement[] {
24
23
 
25
24
  let cpNode = mat.cpNode;
26
25
  if (!cpNode) { return []; }
@@ -30,8 +29,7 @@ const altClasses = [
30
29
  const $svgs: SVGElement[] = [];
31
30
 
32
31
  let i = 0;
33
- traverseEdges(cpNode, async cpNode => {
34
- // await sleep(50);
32
+ traverseEdges(cpNode, cpNode => {
35
33
  if (isTerminating(cpNode)) { return; }
36
34
 
37
35
  const bezier = getMatCurveToNext(cpNode);
@@ -45,9 +43,4 @@ const altClasses = [
45
43
  }
46
44
 
47
45
 
48
- function drawCurve() {
49
-
50
- }
51
-
52
-
53
46
  export { drawMat }
package/tsconfig.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "strict": true,
4
- "module": "es2022",
5
- "target": "es2022",
4
+ "module": "esnext",
5
+ "target": "esnext",
6
6
  "declaration": true,
7
7
  "noEmitOnError": true,
8
8
  "sourceMap": true,
9
- "outDir": "node",
10
- "moduleResolution": "node"
9
+ "rootDir": "./src",
10
+ "outDir": "./node",
11
+ "moduleResolution": "bundler"
11
12
  },
12
13
  "include": [
13
14
  "src/index.ts"