@canopy-io/node 0.7.0 → 0.7.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @canopy-io/node
2
2
 
3
+ ## 0.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 221e502: `LocalAuthorizer` keeps its copy of the hierarchy in about 40% less memory: one id string per node instead of two. A parsed `GET /api/v1/nodes/parents` response holds each node id twice, as the node's own `id` and again in its children's `parent_node_id`, and the cache used to keep both copies. A 50,000-node hierarchy now costs about 4.6 MB rather than 7.4 MB. Answers are unchanged.
8
+
3
9
  ## 0.7.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1325,8 +1325,16 @@ var LocalAuthorizer = class {
1325
1325
  }
1326
1326
  const parents = /* @__PURE__ */ new Map();
1327
1327
  if (result.modified) {
1328
+ const ids = /* @__PURE__ */ new Map();
1328
1329
  for (const edge of result.data.items) {
1329
- parents.set(edge.id, edge.parent_node_id ?? null);
1330
+ ids.set(edge.id, edge.id);
1331
+ }
1332
+ for (const edge of result.data.items) {
1333
+ const parent = edge.parent_node_id ?? null;
1334
+ parents.set(
1335
+ edge.id,
1336
+ parent === null ? null : ids.get(parent) ?? parent
1337
+ );
1330
1338
  }
1331
1339
  }
1332
1340
  this.tree = {