@opendaw/lib-box 0.0.36 → 0.0.37

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.
@@ -1 +1 @@
1
- {"version":3,"file":"graph-edges.d.ts","sourceRoot":"","sources":["../src/graph-edges.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAA;AACtC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAA;AAEzB,qBAAa,UAAU;;;IAanB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAchD,iBAAiB,CAAC,GAAG,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IAoBrD,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAQpD,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAOtC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO;IAI3D,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,aAAa,CAAC,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAIjE,eAAe,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC;IASlE,oBAAoB,IAAI,IAAI;CAgC/B"}
1
+ {"version":3,"file":"graph-edges.d.ts","sourceRoot":"","sources":["../src/graph-edges.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAA;AACtC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAA;AAEzB,qBAAa,UAAU;;;IAanB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAchD,iBAAiB,CAAC,GAAG,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI;IAoBrD,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAQpD,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAOtC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO;IAI3D,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,aAAa,CAAC,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAIjE,eAAe,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC;IASlE,oBAAoB,IAAI,IAAI;CAsC/B"}
@@ -1,4 +1,4 @@
1
- import { Arrays, assert, isDefined, isInstanceOf, panic } from "@opendaw/lib-std";
1
+ import { Arrays, isDefined, isInstanceOf, panic } from "@opendaw/lib-std";
2
2
  import { Address } from "./address";
3
3
  import { PointerField } from "./pointer";
4
4
  export class GraphEdges {
@@ -74,8 +74,13 @@ export class GraphEdges {
74
74
  }
75
75
  }
76
76
  validateRequirements() {
77
+ // TODO I removed the assertions because they were too slow in busy graphs.
78
+ // I tried to use a Set<Box> in BoxGraph, but that wasn't faster than the SortedSet.
79
+ // We could just use a boolean in Box, but it could be set from the outside world and break it.
80
+ // Claude suggest to use dirty sets, but I am too lazy to implement it right now.
81
+ // const now = performance.now()
77
82
  this.#requiresTarget.forEach(pointer => {
78
- assert(pointer.isAttached(), `Pointer ${pointer.address.toString()} is not attached`);
83
+ // assert(pointer.isAttached(), `Pointer ${pointer.address.toString()} is not attached`)
79
84
  if (pointer.isEmpty()) {
80
85
  if (pointer.mandatory) {
81
86
  return panic(`Pointer ${pointer.toString()} requires an edge.`);
@@ -86,7 +91,7 @@ export class GraphEdges {
86
91
  }
87
92
  });
88
93
  this.#requiresPointer.forEach(target => {
89
- assert(target.isAttached(), `Target ${target.address.toString()} is not attached`);
94
+ // assert(target.isAttached(), `Target ${target.address.toString()} is not attached`)
90
95
  if (target.pointerHub.isEmpty()) {
91
96
  if (target.pointerRules.mandatory) {
92
97
  return panic(`Target ${target.toString()} requires an edge.`);
@@ -96,6 +101,7 @@ export class GraphEdges {
96
101
  }
97
102
  }
98
103
  });
104
+ // console.debug(`GraphEdges validation took ${performance.now() - now} ms.`)
99
105
  }
100
106
  #collectSameBox(set, id, map) {
101
107
  const range = Address.boxRange(set, id, map);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendaw/lib-box",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "LGPL-3.0-or-later",
@@ -22,12 +22,12 @@
22
22
  "test": "vitest run"
23
23
  },
24
24
  "dependencies": {
25
- "@opendaw/lib-runtime": "^0.0.36",
26
- "@opendaw/lib-std": "^0.0.36"
25
+ "@opendaw/lib-runtime": "^0.0.37",
26
+ "@opendaw/lib-std": "^0.0.37"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@opendaw/eslint-config": "^0.0.20",
30
30
  "@opendaw/typescript-config": "^0.0.20"
31
31
  },
32
- "gitHead": "a3c95d33522ce3b35c1a67af0fd6064488d35c97"
32
+ "gitHead": "cbe2d3409a066196db3434a48f61320f29c80d99"
33
33
  }