@milaboratories/pl-tree 1.8.47 → 1.8.49

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.
Files changed (57) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/accessors.cjs +236 -273
  3. package/dist/accessors.cjs.map +1 -1
  4. package/dist/accessors.d.ts +93 -93
  5. package/dist/accessors.js +235 -271
  6. package/dist/accessors.js.map +1 -1
  7. package/dist/dump.cjs +79 -80
  8. package/dist/dump.cjs.map +1 -1
  9. package/dist/dump.d.ts +16 -18
  10. package/dist/dump.js +79 -79
  11. package/dist/dump.js.map +1 -1
  12. package/dist/index.cjs +31 -35
  13. package/dist/index.d.ts +10 -10
  14. package/dist/index.js +9 -8
  15. package/dist/snapshot.cjs +50 -71
  16. package/dist/snapshot.cjs.map +1 -1
  17. package/dist/snapshot.d.ts +36 -38
  18. package/dist/snapshot.js +49 -69
  19. package/dist/snapshot.js.map +1 -1
  20. package/dist/state.cjs +487 -624
  21. package/dist/state.cjs.map +1 -1
  22. package/dist/state.d.ts +117 -116
  23. package/dist/state.js +486 -622
  24. package/dist/state.js.map +1 -1
  25. package/dist/sync.cjs +113 -133
  26. package/dist/sync.cjs.map +1 -1
  27. package/dist/sync.d.ts +37 -33
  28. package/dist/sync.js +111 -131
  29. package/dist/sync.js.map +1 -1
  30. package/dist/synchronized_tree.cjs +167 -232
  31. package/dist/synchronized_tree.cjs.map +1 -1
  32. package/dist/synchronized_tree.d.ts +66 -68
  33. package/dist/synchronized_tree.js +165 -211
  34. package/dist/synchronized_tree.js.map +1 -1
  35. package/dist/traversal_ops.d.ts +42 -42
  36. package/dist/value_and_error.cjs +9 -12
  37. package/dist/value_and_error.cjs.map +1 -1
  38. package/dist/value_and_error.d.ts +8 -5
  39. package/dist/value_and_error.js +9 -11
  40. package/dist/value_and_error.js.map +1 -1
  41. package/dist/value_or_error.d.ts +8 -5
  42. package/package.json +9 -9
  43. package/src/synchronized_tree.ts +10 -5
  44. package/dist/accessors.d.ts.map +0 -1
  45. package/dist/dump.d.ts.map +0 -1
  46. package/dist/index.cjs.map +0 -1
  47. package/dist/index.d.ts.map +0 -1
  48. package/dist/index.js.map +0 -1
  49. package/dist/snapshot.d.ts.map +0 -1
  50. package/dist/state.d.ts.map +0 -1
  51. package/dist/sync.d.ts.map +0 -1
  52. package/dist/synchronized_tree.d.ts.map +0 -1
  53. package/dist/test_utils.d.ts +0 -25
  54. package/dist/test_utils.d.ts.map +0 -1
  55. package/dist/traversal_ops.d.ts.map +0 -1
  56. package/dist/value_and_error.d.ts.map +0 -1
  57. package/dist/value_or_error.d.ts.map +0 -1
package/dist/dump.cjs CHANGED
@@ -1,86 +1,85 @@
1
- 'use strict';
2
1
 
2
+ //#region src/dump.ts
3
3
  /**
4
- * Analyzes a collection of resources and generates statistics grouped by resource type.
5
- *
6
- * This function processes an array of ExtendedResourceData and calculates various metrics
7
- * for each unique resource type, including:
8
- * - Count of resources
9
- * - Total bytes in field names
10
- * - Total number of fields
11
- * - Total bytes in resource data
12
- * - Total number of key-value records
13
- * - Total bytes in key-value records
14
- *
15
- * The statistics are organized by resource type using a key in the format "typeName/version".
16
- *
17
- * @param dumpStats - Array of ExtendedResourceData objects to analyze
18
- * @returns A DumpStats object containing statistics for each resource type
19
- * @example
20
- * ```typescript
21
- * const resources = [...]; // Array of ExtendedResourceData
22
- * const stats = treeDumpStats(resources);
23
- * // stats = {
24
- * // "MyResource/1": {
25
- * // count: 5,
26
- * // fieldNameBytes: 150,
27
- * // fieldsCount: 10,
28
- * // dataBytes: 1024,
29
- * // kvCount: 3,
30
- * // kvBytes: 256
31
- * // },
32
- * // ...
33
- * // }
34
- * ```
35
- */
4
+ * Analyzes a collection of resources and generates statistics grouped by resource type.
5
+ *
6
+ * This function processes an array of ExtendedResourceData and calculates various metrics
7
+ * for each unique resource type, including:
8
+ * - Count of resources
9
+ * - Total bytes in field names
10
+ * - Total number of fields
11
+ * - Total bytes in resource data
12
+ * - Total number of key-value records
13
+ * - Total bytes in key-value records
14
+ *
15
+ * The statistics are organized by resource type using a key in the format "typeName/version".
16
+ *
17
+ * @param dumpStats - Array of ExtendedResourceData objects to analyze
18
+ * @returns A DumpStats object containing statistics for each resource type
19
+ * @example
20
+ * ```typescript
21
+ * const resources = [...]; // Array of ExtendedResourceData
22
+ * const stats = treeDumpStats(resources);
23
+ * // stats = {
24
+ * // "MyResource/1": {
25
+ * // count: 5,
26
+ * // fieldNameBytes: 150,
27
+ * // fieldsCount: 10,
28
+ * // dataBytes: 1024,
29
+ * // kvCount: 3,
30
+ * // kvBytes: 256
31
+ * // },
32
+ * // ...
33
+ * // }
34
+ * ```
35
+ */
36
36
  function treeDumpStats(dumpStats) {
37
- const stats = {
38
- total: {
39
- count: 0,
40
- fieldNameBytes: 0,
41
- fieldsCount: 0,
42
- dataBytes: 0,
43
- kvCount: 0,
44
- kvBytes: 0,
45
- },
46
- byResourceType: {},
47
- };
48
- for (const resource of dumpStats) {
49
- const typeKey = `${resource.type.name}/${resource.type.version}`;
50
- if (!stats.byResourceType[typeKey]) {
51
- stats.byResourceType[typeKey] = {
52
- count: 0,
53
- fieldNameBytes: 0,
54
- fieldsCount: 0,
55
- dataBytes: 0,
56
- kvCount: 0,
57
- kvBytes: 0,
58
- };
59
- }
60
- const typeStats = stats.byResourceType[typeKey];
61
- typeStats.count++;
62
- stats.total.count++;
63
- for (const field of resource.fields) {
64
- typeStats.fieldNameBytes += field.name.length;
65
- typeStats.fieldsCount++;
66
- stats.total.fieldNameBytes += field.name.length;
67
- stats.total.fieldsCount++;
68
- }
69
- if (resource.data) {
70
- const dataLength = resource.data?.length ?? 0;
71
- typeStats.dataBytes += dataLength;
72
- stats.total.dataBytes += dataLength;
73
- }
74
- typeStats.kvCount += resource.kv.length;
75
- stats.total.kvCount += resource.kv.length;
76
- for (const kv of resource.kv) {
77
- const kvLength = kv.key.length + kv.value.length;
78
- typeStats.kvBytes += kvLength;
79
- stats.total.kvBytes += kvLength;
80
- }
81
- }
82
- return stats;
37
+ const stats = {
38
+ total: {
39
+ count: 0,
40
+ fieldNameBytes: 0,
41
+ fieldsCount: 0,
42
+ dataBytes: 0,
43
+ kvCount: 0,
44
+ kvBytes: 0
45
+ },
46
+ byResourceType: {}
47
+ };
48
+ for (const resource of dumpStats) {
49
+ const typeKey = `${resource.type.name}/${resource.type.version}`;
50
+ if (!stats.byResourceType[typeKey]) stats.byResourceType[typeKey] = {
51
+ count: 0,
52
+ fieldNameBytes: 0,
53
+ fieldsCount: 0,
54
+ dataBytes: 0,
55
+ kvCount: 0,
56
+ kvBytes: 0
57
+ };
58
+ const typeStats = stats.byResourceType[typeKey];
59
+ typeStats.count++;
60
+ stats.total.count++;
61
+ for (const field of resource.fields) {
62
+ typeStats.fieldNameBytes += field.name.length;
63
+ typeStats.fieldsCount++;
64
+ stats.total.fieldNameBytes += field.name.length;
65
+ stats.total.fieldsCount++;
66
+ }
67
+ if (resource.data) {
68
+ const dataLength = resource.data?.length ?? 0;
69
+ typeStats.dataBytes += dataLength;
70
+ stats.total.dataBytes += dataLength;
71
+ }
72
+ typeStats.kvCount += resource.kv.length;
73
+ stats.total.kvCount += resource.kv.length;
74
+ for (const kv of resource.kv) {
75
+ const kvLength = kv.key.length + kv.value.length;
76
+ typeStats.kvBytes += kvLength;
77
+ stats.total.kvBytes += kvLength;
78
+ }
79
+ }
80
+ return stats;
83
81
  }
84
82
 
83
+ //#endregion
85
84
  exports.treeDumpStats = treeDumpStats;
86
- //# sourceMappingURL=dump.cjs.map
85
+ //# sourceMappingURL=dump.cjs.map
package/dist/dump.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dump.cjs","sources":["../src/dump.ts"],"sourcesContent":["import type { ExtendedResourceData } from \"./state\";\n\nexport type ResourceStats = {\n /** Number of resources of this type */\n count: number;\n /** Total number of bytes in the field names of all resources of this type */\n fieldNameBytes: number;\n /** Total number of fields in all resources of this type */\n fieldsCount: number;\n /** Total number of bytes in the data of all resources of this type */\n dataBytes: number;\n /** Total number of key-value records in all resources of this type */\n kvCount: number;\n /** Total number of bytes in the key-value records of all resources of this type */\n kvBytes: number;\n};\n\n/**\n * A map of resource type statistics, keyed by the resource type name and version.\n *\n * @type {Record<string, ResourceStats>}\n */\nexport type TreeDumpStats = {\n total: ResourceStats;\n byResourceType: Record<`${string}/${string}`, ResourceStats>;\n};\n\n/**\n * Analyzes a collection of resources and generates statistics grouped by resource type.\n *\n * This function processes an array of ExtendedResourceData and calculates various metrics\n * for each unique resource type, including:\n * - Count of resources\n * - Total bytes in field names\n * - Total number of fields\n * - Total bytes in resource data\n * - Total number of key-value records\n * - Total bytes in key-value records\n *\n * The statistics are organized by resource type using a key in the format \"typeName/version\".\n *\n * @param dumpStats - Array of ExtendedResourceData objects to analyze\n * @returns A DumpStats object containing statistics for each resource type\n * @example\n * ```typescript\n * const resources = [...]; // Array of ExtendedResourceData\n * const stats = treeDumpStats(resources);\n * // stats = {\n * // \"MyResource/1\": {\n * // count: 5,\n * // fieldNameBytes: 150,\n * // fieldsCount: 10,\n * // dataBytes: 1024,\n * // kvCount: 3,\n * // kvBytes: 256\n * // },\n * // ...\n * // }\n * ```\n */\nexport function treeDumpStats(dumpStats: ExtendedResourceData[]): TreeDumpStats {\n const stats: TreeDumpStats = {\n total: {\n count: 0,\n fieldNameBytes: 0,\n fieldsCount: 0,\n dataBytes: 0,\n kvCount: 0,\n kvBytes: 0,\n },\n byResourceType: {},\n };\n\n for (const resource of dumpStats) {\n const typeKey = `${resource.type.name}/${resource.type.version}` as const;\n if (!stats.byResourceType[typeKey]) {\n stats.byResourceType[typeKey] = {\n count: 0,\n fieldNameBytes: 0,\n fieldsCount: 0,\n dataBytes: 0,\n kvCount: 0,\n kvBytes: 0,\n };\n }\n\n const typeStats = stats.byResourceType[typeKey];\n typeStats.count++;\n stats.total.count++;\n\n for (const field of resource.fields) {\n typeStats.fieldNameBytes += field.name.length;\n typeStats.fieldsCount++;\n stats.total.fieldNameBytes += field.name.length;\n stats.total.fieldsCount++;\n }\n\n if (resource.data) {\n const dataLength = resource.data?.length ?? 0;\n typeStats.dataBytes += dataLength;\n stats.total.dataBytes += dataLength;\n }\n\n typeStats.kvCount += resource.kv.length;\n stats.total.kvCount += resource.kv.length;\n\n for (const kv of resource.kv) {\n const kvLength = kv.key.length + kv.value.length;\n typeStats.kvBytes += kvLength;\n stats.total.kvBytes += kvLength;\n }\n }\n\n return stats;\n}\n"],"names":[],"mappings":";;AA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACG,SAAU,aAAa,CAAC,SAAiC,EAAA;AAC7D,IAAA,MAAM,KAAK,GAAkB;AAC3B,QAAA,KAAK,EAAE;AACL,YAAA,KAAK,EAAE,CAAC;AACR,YAAA,cAAc,EAAE,CAAC;AACjB,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACD,QAAA,cAAc,EAAE,EAAE;KACnB;AAED,IAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,QAAA,MAAM,OAAO,GAAG,CAAA,EAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAA,CAAA,EAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAW;QACzE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;AAClC,YAAA,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG;AAC9B,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,cAAc,EAAE,CAAC;AACjB,gBAAA,WAAW,EAAE,CAAC;AACd,gBAAA,SAAS,EAAE,CAAC;AACZ,gBAAA,OAAO,EAAE,CAAC;AACV,gBAAA,OAAO,EAAE,CAAC;aACX;QACH;QAEA,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;QAC/C,SAAS,CAAC,KAAK,EAAE;AACjB,QAAA,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;AAEnB,QAAA,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,MAAM,EAAE;YACnC,SAAS,CAAC,cAAc,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM;YAC7C,SAAS,CAAC,WAAW,EAAE;YACvB,KAAK,CAAC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM;AAC/C,YAAA,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE;QAC3B;AAEA,QAAA,IAAI,QAAQ,CAAC,IAAI,EAAE;YACjB,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC;AAC7C,YAAA,SAAS,CAAC,SAAS,IAAI,UAAU;AACjC,YAAA,KAAK,CAAC,KAAK,CAAC,SAAS,IAAI,UAAU;QACrC;QAEA,SAAS,CAAC,OAAO,IAAI,QAAQ,CAAC,EAAE,CAAC,MAAM;QACvC,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,QAAQ,CAAC,EAAE,CAAC,MAAM;AAEzC,QAAA,KAAK,MAAM,EAAE,IAAI,QAAQ,CAAC,EAAE,EAAE;AAC5B,YAAA,MAAM,QAAQ,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM;AAChD,YAAA,SAAS,CAAC,OAAO,IAAI,QAAQ;AAC7B,YAAA,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,QAAQ;QACjC;IACF;AAEA,IAAA,OAAO,KAAK;AACd;;;;"}
1
+ {"version":3,"file":"dump.cjs","names":[],"sources":["../src/dump.ts"],"sourcesContent":["import type { ExtendedResourceData } from \"./state\";\n\nexport type ResourceStats = {\n /** Number of resources of this type */\n count: number;\n /** Total number of bytes in the field names of all resources of this type */\n fieldNameBytes: number;\n /** Total number of fields in all resources of this type */\n fieldsCount: number;\n /** Total number of bytes in the data of all resources of this type */\n dataBytes: number;\n /** Total number of key-value records in all resources of this type */\n kvCount: number;\n /** Total number of bytes in the key-value records of all resources of this type */\n kvBytes: number;\n};\n\n/**\n * A map of resource type statistics, keyed by the resource type name and version.\n *\n * @type {Record<string, ResourceStats>}\n */\nexport type TreeDumpStats = {\n total: ResourceStats;\n byResourceType: Record<`${string}/${string}`, ResourceStats>;\n};\n\n/**\n * Analyzes a collection of resources and generates statistics grouped by resource type.\n *\n * This function processes an array of ExtendedResourceData and calculates various metrics\n * for each unique resource type, including:\n * - Count of resources\n * - Total bytes in field names\n * - Total number of fields\n * - Total bytes in resource data\n * - Total number of key-value records\n * - Total bytes in key-value records\n *\n * The statistics are organized by resource type using a key in the format \"typeName/version\".\n *\n * @param dumpStats - Array of ExtendedResourceData objects to analyze\n * @returns A DumpStats object containing statistics for each resource type\n * @example\n * ```typescript\n * const resources = [...]; // Array of ExtendedResourceData\n * const stats = treeDumpStats(resources);\n * // stats = {\n * // \"MyResource/1\": {\n * // count: 5,\n * // fieldNameBytes: 150,\n * // fieldsCount: 10,\n * // dataBytes: 1024,\n * // kvCount: 3,\n * // kvBytes: 256\n * // },\n * // ...\n * // }\n * ```\n */\nexport function treeDumpStats(dumpStats: ExtendedResourceData[]): TreeDumpStats {\n const stats: TreeDumpStats = {\n total: {\n count: 0,\n fieldNameBytes: 0,\n fieldsCount: 0,\n dataBytes: 0,\n kvCount: 0,\n kvBytes: 0,\n },\n byResourceType: {},\n };\n\n for (const resource of dumpStats) {\n const typeKey = `${resource.type.name}/${resource.type.version}` as const;\n if (!stats.byResourceType[typeKey]) {\n stats.byResourceType[typeKey] = {\n count: 0,\n fieldNameBytes: 0,\n fieldsCount: 0,\n dataBytes: 0,\n kvCount: 0,\n kvBytes: 0,\n };\n }\n\n const typeStats = stats.byResourceType[typeKey];\n typeStats.count++;\n stats.total.count++;\n\n for (const field of resource.fields) {\n typeStats.fieldNameBytes += field.name.length;\n typeStats.fieldsCount++;\n stats.total.fieldNameBytes += field.name.length;\n stats.total.fieldsCount++;\n }\n\n if (resource.data) {\n const dataLength = resource.data?.length ?? 0;\n typeStats.dataBytes += dataLength;\n stats.total.dataBytes += dataLength;\n }\n\n typeStats.kvCount += resource.kv.length;\n stats.total.kvCount += resource.kv.length;\n\n for (const kv of resource.kv) {\n const kvLength = kv.key.length + kv.value.length;\n typeStats.kvBytes += kvLength;\n stats.total.kvBytes += kvLength;\n }\n }\n\n return stats;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,SAAgB,cAAc,WAAkD;CAC9E,MAAM,QAAuB;EAC3B,OAAO;GACL,OAAO;GACP,gBAAgB;GAChB,aAAa;GACb,WAAW;GACX,SAAS;GACT,SAAS;GACV;EACD,gBAAgB,EAAE;EACnB;AAED,MAAK,MAAM,YAAY,WAAW;EAChC,MAAM,UAAU,GAAG,SAAS,KAAK,KAAK,GAAG,SAAS,KAAK;AACvD,MAAI,CAAC,MAAM,eAAe,SACxB,OAAM,eAAe,WAAW;GAC9B,OAAO;GACP,gBAAgB;GAChB,aAAa;GACb,WAAW;GACX,SAAS;GACT,SAAS;GACV;EAGH,MAAM,YAAY,MAAM,eAAe;AACvC,YAAU;AACV,QAAM,MAAM;AAEZ,OAAK,MAAM,SAAS,SAAS,QAAQ;AACnC,aAAU,kBAAkB,MAAM,KAAK;AACvC,aAAU;AACV,SAAM,MAAM,kBAAkB,MAAM,KAAK;AACzC,SAAM,MAAM;;AAGd,MAAI,SAAS,MAAM;GACjB,MAAM,aAAa,SAAS,MAAM,UAAU;AAC5C,aAAU,aAAa;AACvB,SAAM,MAAM,aAAa;;AAG3B,YAAU,WAAW,SAAS,GAAG;AACjC,QAAM,MAAM,WAAW,SAAS,GAAG;AAEnC,OAAK,MAAM,MAAM,SAAS,IAAI;GAC5B,MAAM,WAAW,GAAG,IAAI,SAAS,GAAG,MAAM;AAC1C,aAAU,WAAW;AACrB,SAAM,MAAM,WAAW;;;AAI3B,QAAO"}
package/dist/dump.d.ts CHANGED
@@ -1,26 +1,22 @@
1
- import type { ExtendedResourceData } from "./state";
2
- export type ResourceStats = {
3
- /** Number of resources of this type */
4
- count: number;
5
- /** Total number of bytes in the field names of all resources of this type */
6
- fieldNameBytes: number;
7
- /** Total number of fields in all resources of this type */
8
- fieldsCount: number;
9
- /** Total number of bytes in the data of all resources of this type */
10
- dataBytes: number;
11
- /** Total number of key-value records in all resources of this type */
12
- kvCount: number;
13
- /** Total number of bytes in the key-value records of all resources of this type */
14
- kvBytes: number;
1
+ import { ExtendedResourceData } from "./state.js";
2
+
3
+ //#region src/dump.d.ts
4
+ type ResourceStats = {
5
+ /** Number of resources of this type */count: number; /** Total number of bytes in the field names of all resources of this type */
6
+ fieldNameBytes: number; /** Total number of fields in all resources of this type */
7
+ fieldsCount: number; /** Total number of bytes in the data of all resources of this type */
8
+ dataBytes: number; /** Total number of key-value records in all resources of this type */
9
+ kvCount: number; /** Total number of bytes in the key-value records of all resources of this type */
10
+ kvBytes: number;
15
11
  };
16
12
  /**
17
13
  * A map of resource type statistics, keyed by the resource type name and version.
18
14
  *
19
15
  * @type {Record<string, ResourceStats>}
20
16
  */
21
- export type TreeDumpStats = {
22
- total: ResourceStats;
23
- byResourceType: Record<`${string}/${string}`, ResourceStats>;
17
+ type TreeDumpStats = {
18
+ total: ResourceStats;
19
+ byResourceType: Record<`${string}/${string}`, ResourceStats>;
24
20
  };
25
21
  /**
26
22
  * Analyzes a collection of resources and generates statistics grouped by resource type.
@@ -55,5 +51,7 @@ export type TreeDumpStats = {
55
51
  * // }
56
52
  * ```
57
53
  */
58
- export declare function treeDumpStats(dumpStats: ExtendedResourceData[]): TreeDumpStats;
54
+ declare function treeDumpStats(dumpStats: ExtendedResourceData[]): TreeDumpStats;
55
+ //#endregion
56
+ export { ResourceStats, TreeDumpStats, treeDumpStats };
59
57
  //# sourceMappingURL=dump.d.ts.map
package/dist/dump.js CHANGED
@@ -1,84 +1,84 @@
1
+ //#region src/dump.ts
1
2
  /**
2
- * Analyzes a collection of resources and generates statistics grouped by resource type.
3
- *
4
- * This function processes an array of ExtendedResourceData and calculates various metrics
5
- * for each unique resource type, including:
6
- * - Count of resources
7
- * - Total bytes in field names
8
- * - Total number of fields
9
- * - Total bytes in resource data
10
- * - Total number of key-value records
11
- * - Total bytes in key-value records
12
- *
13
- * The statistics are organized by resource type using a key in the format "typeName/version".
14
- *
15
- * @param dumpStats - Array of ExtendedResourceData objects to analyze
16
- * @returns A DumpStats object containing statistics for each resource type
17
- * @example
18
- * ```typescript
19
- * const resources = [...]; // Array of ExtendedResourceData
20
- * const stats = treeDumpStats(resources);
21
- * // stats = {
22
- * // "MyResource/1": {
23
- * // count: 5,
24
- * // fieldNameBytes: 150,
25
- * // fieldsCount: 10,
26
- * // dataBytes: 1024,
27
- * // kvCount: 3,
28
- * // kvBytes: 256
29
- * // },
30
- * // ...
31
- * // }
32
- * ```
33
- */
3
+ * Analyzes a collection of resources and generates statistics grouped by resource type.
4
+ *
5
+ * This function processes an array of ExtendedResourceData and calculates various metrics
6
+ * for each unique resource type, including:
7
+ * - Count of resources
8
+ * - Total bytes in field names
9
+ * - Total number of fields
10
+ * - Total bytes in resource data
11
+ * - Total number of key-value records
12
+ * - Total bytes in key-value records
13
+ *
14
+ * The statistics are organized by resource type using a key in the format "typeName/version".
15
+ *
16
+ * @param dumpStats - Array of ExtendedResourceData objects to analyze
17
+ * @returns A DumpStats object containing statistics for each resource type
18
+ * @example
19
+ * ```typescript
20
+ * const resources = [...]; // Array of ExtendedResourceData
21
+ * const stats = treeDumpStats(resources);
22
+ * // stats = {
23
+ * // "MyResource/1": {
24
+ * // count: 5,
25
+ * // fieldNameBytes: 150,
26
+ * // fieldsCount: 10,
27
+ * // dataBytes: 1024,
28
+ * // kvCount: 3,
29
+ * // kvBytes: 256
30
+ * // },
31
+ * // ...
32
+ * // }
33
+ * ```
34
+ */
34
35
  function treeDumpStats(dumpStats) {
35
- const stats = {
36
- total: {
37
- count: 0,
38
- fieldNameBytes: 0,
39
- fieldsCount: 0,
40
- dataBytes: 0,
41
- kvCount: 0,
42
- kvBytes: 0,
43
- },
44
- byResourceType: {},
45
- };
46
- for (const resource of dumpStats) {
47
- const typeKey = `${resource.type.name}/${resource.type.version}`;
48
- if (!stats.byResourceType[typeKey]) {
49
- stats.byResourceType[typeKey] = {
50
- count: 0,
51
- fieldNameBytes: 0,
52
- fieldsCount: 0,
53
- dataBytes: 0,
54
- kvCount: 0,
55
- kvBytes: 0,
56
- };
57
- }
58
- const typeStats = stats.byResourceType[typeKey];
59
- typeStats.count++;
60
- stats.total.count++;
61
- for (const field of resource.fields) {
62
- typeStats.fieldNameBytes += field.name.length;
63
- typeStats.fieldsCount++;
64
- stats.total.fieldNameBytes += field.name.length;
65
- stats.total.fieldsCount++;
66
- }
67
- if (resource.data) {
68
- const dataLength = resource.data?.length ?? 0;
69
- typeStats.dataBytes += dataLength;
70
- stats.total.dataBytes += dataLength;
71
- }
72
- typeStats.kvCount += resource.kv.length;
73
- stats.total.kvCount += resource.kv.length;
74
- for (const kv of resource.kv) {
75
- const kvLength = kv.key.length + kv.value.length;
76
- typeStats.kvBytes += kvLength;
77
- stats.total.kvBytes += kvLength;
78
- }
79
- }
80
- return stats;
36
+ const stats = {
37
+ total: {
38
+ count: 0,
39
+ fieldNameBytes: 0,
40
+ fieldsCount: 0,
41
+ dataBytes: 0,
42
+ kvCount: 0,
43
+ kvBytes: 0
44
+ },
45
+ byResourceType: {}
46
+ };
47
+ for (const resource of dumpStats) {
48
+ const typeKey = `${resource.type.name}/${resource.type.version}`;
49
+ if (!stats.byResourceType[typeKey]) stats.byResourceType[typeKey] = {
50
+ count: 0,
51
+ fieldNameBytes: 0,
52
+ fieldsCount: 0,
53
+ dataBytes: 0,
54
+ kvCount: 0,
55
+ kvBytes: 0
56
+ };
57
+ const typeStats = stats.byResourceType[typeKey];
58
+ typeStats.count++;
59
+ stats.total.count++;
60
+ for (const field of resource.fields) {
61
+ typeStats.fieldNameBytes += field.name.length;
62
+ typeStats.fieldsCount++;
63
+ stats.total.fieldNameBytes += field.name.length;
64
+ stats.total.fieldsCount++;
65
+ }
66
+ if (resource.data) {
67
+ const dataLength = resource.data?.length ?? 0;
68
+ typeStats.dataBytes += dataLength;
69
+ stats.total.dataBytes += dataLength;
70
+ }
71
+ typeStats.kvCount += resource.kv.length;
72
+ stats.total.kvCount += resource.kv.length;
73
+ for (const kv of resource.kv) {
74
+ const kvLength = kv.key.length + kv.value.length;
75
+ typeStats.kvBytes += kvLength;
76
+ stats.total.kvBytes += kvLength;
77
+ }
78
+ }
79
+ return stats;
81
80
  }
82
81
 
82
+ //#endregion
83
83
  export { treeDumpStats };
84
- //# sourceMappingURL=dump.js.map
84
+ //# sourceMappingURL=dump.js.map
package/dist/dump.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dump.js","sources":["../src/dump.ts"],"sourcesContent":["import type { ExtendedResourceData } from \"./state\";\n\nexport type ResourceStats = {\n /** Number of resources of this type */\n count: number;\n /** Total number of bytes in the field names of all resources of this type */\n fieldNameBytes: number;\n /** Total number of fields in all resources of this type */\n fieldsCount: number;\n /** Total number of bytes in the data of all resources of this type */\n dataBytes: number;\n /** Total number of key-value records in all resources of this type */\n kvCount: number;\n /** Total number of bytes in the key-value records of all resources of this type */\n kvBytes: number;\n};\n\n/**\n * A map of resource type statistics, keyed by the resource type name and version.\n *\n * @type {Record<string, ResourceStats>}\n */\nexport type TreeDumpStats = {\n total: ResourceStats;\n byResourceType: Record<`${string}/${string}`, ResourceStats>;\n};\n\n/**\n * Analyzes a collection of resources and generates statistics grouped by resource type.\n *\n * This function processes an array of ExtendedResourceData and calculates various metrics\n * for each unique resource type, including:\n * - Count of resources\n * - Total bytes in field names\n * - Total number of fields\n * - Total bytes in resource data\n * - Total number of key-value records\n * - Total bytes in key-value records\n *\n * The statistics are organized by resource type using a key in the format \"typeName/version\".\n *\n * @param dumpStats - Array of ExtendedResourceData objects to analyze\n * @returns A DumpStats object containing statistics for each resource type\n * @example\n * ```typescript\n * const resources = [...]; // Array of ExtendedResourceData\n * const stats = treeDumpStats(resources);\n * // stats = {\n * // \"MyResource/1\": {\n * // count: 5,\n * // fieldNameBytes: 150,\n * // fieldsCount: 10,\n * // dataBytes: 1024,\n * // kvCount: 3,\n * // kvBytes: 256\n * // },\n * // ...\n * // }\n * ```\n */\nexport function treeDumpStats(dumpStats: ExtendedResourceData[]): TreeDumpStats {\n const stats: TreeDumpStats = {\n total: {\n count: 0,\n fieldNameBytes: 0,\n fieldsCount: 0,\n dataBytes: 0,\n kvCount: 0,\n kvBytes: 0,\n },\n byResourceType: {},\n };\n\n for (const resource of dumpStats) {\n const typeKey = `${resource.type.name}/${resource.type.version}` as const;\n if (!stats.byResourceType[typeKey]) {\n stats.byResourceType[typeKey] = {\n count: 0,\n fieldNameBytes: 0,\n fieldsCount: 0,\n dataBytes: 0,\n kvCount: 0,\n kvBytes: 0,\n };\n }\n\n const typeStats = stats.byResourceType[typeKey];\n typeStats.count++;\n stats.total.count++;\n\n for (const field of resource.fields) {\n typeStats.fieldNameBytes += field.name.length;\n typeStats.fieldsCount++;\n stats.total.fieldNameBytes += field.name.length;\n stats.total.fieldsCount++;\n }\n\n if (resource.data) {\n const dataLength = resource.data?.length ?? 0;\n typeStats.dataBytes += dataLength;\n stats.total.dataBytes += dataLength;\n }\n\n typeStats.kvCount += resource.kv.length;\n stats.total.kvCount += resource.kv.length;\n\n for (const kv of resource.kv) {\n const kvLength = kv.key.length + kv.value.length;\n typeStats.kvBytes += kvLength;\n stats.total.kvBytes += kvLength;\n }\n }\n\n return stats;\n}\n"],"names":[],"mappings":"AA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACG,SAAU,aAAa,CAAC,SAAiC,EAAA;AAC7D,IAAA,MAAM,KAAK,GAAkB;AAC3B,QAAA,KAAK,EAAE;AACL,YAAA,KAAK,EAAE,CAAC;AACR,YAAA,cAAc,EAAE,CAAC;AACjB,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACD,QAAA,cAAc,EAAE,EAAE;KACnB;AAED,IAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,QAAA,MAAM,OAAO,GAAG,CAAA,EAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAA,CAAA,EAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAW;QACzE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;AAClC,YAAA,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG;AAC9B,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,cAAc,EAAE,CAAC;AACjB,gBAAA,WAAW,EAAE,CAAC;AACd,gBAAA,SAAS,EAAE,CAAC;AACZ,gBAAA,OAAO,EAAE,CAAC;AACV,gBAAA,OAAO,EAAE,CAAC;aACX;QACH;QAEA,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;QAC/C,SAAS,CAAC,KAAK,EAAE;AACjB,QAAA,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;AAEnB,QAAA,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,MAAM,EAAE;YACnC,SAAS,CAAC,cAAc,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM;YAC7C,SAAS,CAAC,WAAW,EAAE;YACvB,KAAK,CAAC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM;AAC/C,YAAA,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE;QAC3B;AAEA,QAAA,IAAI,QAAQ,CAAC,IAAI,EAAE;YACjB,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC;AAC7C,YAAA,SAAS,CAAC,SAAS,IAAI,UAAU;AACjC,YAAA,KAAK,CAAC,KAAK,CAAC,SAAS,IAAI,UAAU;QACrC;QAEA,SAAS,CAAC,OAAO,IAAI,QAAQ,CAAC,EAAE,CAAC,MAAM;QACvC,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,QAAQ,CAAC,EAAE,CAAC,MAAM;AAEzC,QAAA,KAAK,MAAM,EAAE,IAAI,QAAQ,CAAC,EAAE,EAAE;AAC5B,YAAA,MAAM,QAAQ,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM;AAChD,YAAA,SAAS,CAAC,OAAO,IAAI,QAAQ;AAC7B,YAAA,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,QAAQ;QACjC;IACF;AAEA,IAAA,OAAO,KAAK;AACd;;;;"}
1
+ {"version":3,"file":"dump.js","names":[],"sources":["../src/dump.ts"],"sourcesContent":["import type { ExtendedResourceData } from \"./state\";\n\nexport type ResourceStats = {\n /** Number of resources of this type */\n count: number;\n /** Total number of bytes in the field names of all resources of this type */\n fieldNameBytes: number;\n /** Total number of fields in all resources of this type */\n fieldsCount: number;\n /** Total number of bytes in the data of all resources of this type */\n dataBytes: number;\n /** Total number of key-value records in all resources of this type */\n kvCount: number;\n /** Total number of bytes in the key-value records of all resources of this type */\n kvBytes: number;\n};\n\n/**\n * A map of resource type statistics, keyed by the resource type name and version.\n *\n * @type {Record<string, ResourceStats>}\n */\nexport type TreeDumpStats = {\n total: ResourceStats;\n byResourceType: Record<`${string}/${string}`, ResourceStats>;\n};\n\n/**\n * Analyzes a collection of resources and generates statistics grouped by resource type.\n *\n * This function processes an array of ExtendedResourceData and calculates various metrics\n * for each unique resource type, including:\n * - Count of resources\n * - Total bytes in field names\n * - Total number of fields\n * - Total bytes in resource data\n * - Total number of key-value records\n * - Total bytes in key-value records\n *\n * The statistics are organized by resource type using a key in the format \"typeName/version\".\n *\n * @param dumpStats - Array of ExtendedResourceData objects to analyze\n * @returns A DumpStats object containing statistics for each resource type\n * @example\n * ```typescript\n * const resources = [...]; // Array of ExtendedResourceData\n * const stats = treeDumpStats(resources);\n * // stats = {\n * // \"MyResource/1\": {\n * // count: 5,\n * // fieldNameBytes: 150,\n * // fieldsCount: 10,\n * // dataBytes: 1024,\n * // kvCount: 3,\n * // kvBytes: 256\n * // },\n * // ...\n * // }\n * ```\n */\nexport function treeDumpStats(dumpStats: ExtendedResourceData[]): TreeDumpStats {\n const stats: TreeDumpStats = {\n total: {\n count: 0,\n fieldNameBytes: 0,\n fieldsCount: 0,\n dataBytes: 0,\n kvCount: 0,\n kvBytes: 0,\n },\n byResourceType: {},\n };\n\n for (const resource of dumpStats) {\n const typeKey = `${resource.type.name}/${resource.type.version}` as const;\n if (!stats.byResourceType[typeKey]) {\n stats.byResourceType[typeKey] = {\n count: 0,\n fieldNameBytes: 0,\n fieldsCount: 0,\n dataBytes: 0,\n kvCount: 0,\n kvBytes: 0,\n };\n }\n\n const typeStats = stats.byResourceType[typeKey];\n typeStats.count++;\n stats.total.count++;\n\n for (const field of resource.fields) {\n typeStats.fieldNameBytes += field.name.length;\n typeStats.fieldsCount++;\n stats.total.fieldNameBytes += field.name.length;\n stats.total.fieldsCount++;\n }\n\n if (resource.data) {\n const dataLength = resource.data?.length ?? 0;\n typeStats.dataBytes += dataLength;\n stats.total.dataBytes += dataLength;\n }\n\n typeStats.kvCount += resource.kv.length;\n stats.total.kvCount += resource.kv.length;\n\n for (const kv of resource.kv) {\n const kvLength = kv.key.length + kv.value.length;\n typeStats.kvBytes += kvLength;\n stats.total.kvBytes += kvLength;\n }\n }\n\n return stats;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,SAAgB,cAAc,WAAkD;CAC9E,MAAM,QAAuB;EAC3B,OAAO;GACL,OAAO;GACP,gBAAgB;GAChB,aAAa;GACb,WAAW;GACX,SAAS;GACT,SAAS;GACV;EACD,gBAAgB,EAAE;EACnB;AAED,MAAK,MAAM,YAAY,WAAW;EAChC,MAAM,UAAU,GAAG,SAAS,KAAK,KAAK,GAAG,SAAS,KAAK;AACvD,MAAI,CAAC,MAAM,eAAe,SACxB,OAAM,eAAe,WAAW;GAC9B,OAAO;GACP,gBAAgB;GAChB,aAAa;GACb,WAAW;GACX,SAAS;GACT,SAAS;GACV;EAGH,MAAM,YAAY,MAAM,eAAe;AACvC,YAAU;AACV,QAAM,MAAM;AAEZ,OAAK,MAAM,SAAS,SAAS,QAAQ;AACnC,aAAU,kBAAkB,MAAM,KAAK;AACvC,aAAU;AACV,SAAM,MAAM,kBAAkB,MAAM,KAAK;AACzC,SAAM,MAAM;;AAGd,MAAI,SAAS,MAAM;GACjB,MAAM,aAAa,SAAS,MAAM,UAAU;AAC5C,aAAU,aAAa;AACvB,SAAM,MAAM,aAAa;;AAG3B,YAAU,WAAW,SAAS,GAAG;AACjC,QAAM,MAAM,WAAW,SAAS,GAAG;AAEnC,OAAK,MAAM,MAAM,SAAS,IAAI;GAC5B,MAAM,WAAW,GAAG,IAAI,SAAS,GAAG,MAAM;AAC1C,aAAU,WAAW;AACrB,SAAM,MAAM,WAAW;;;AAI3B,QAAO"}
package/dist/index.cjs CHANGED
@@ -1,36 +1,32 @@
1
- 'use strict';
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_value_and_error = require('./value_and_error.cjs');
3
+ const require_accessors = require('./accessors.cjs');
4
+ const require_state = require('./state.cjs');
5
+ const require_sync = require('./sync.cjs');
6
+ const require_snapshot = require('./snapshot.cjs');
7
+ const require_synchronized_tree = require('./synchronized_tree.cjs');
8
+ const require_dump = require('./dump.cjs');
2
9
 
3
- var state = require('./state.cjs');
4
- var sync = require('./sync.cjs');
5
- var accessors = require('./accessors.cjs');
6
- var snapshot = require('./snapshot.cjs');
7
- var synchronized_tree = require('./synchronized_tree.cjs');
8
- var value_and_error = require('./value_and_error.cjs');
9
- var dump = require('./dump.cjs');
10
-
11
-
12
-
13
- exports.PlTreeResource = state.PlTreeResource;
14
- exports.PlTreeState = state.PlTreeState;
15
- exports.TreeStateUpdateError = state.TreeStateUpdateError;
16
- exports.constructTreeLoadingRequest = sync.constructTreeLoadingRequest;
17
- exports.formatTreeLoadingStat = sync.formatTreeLoadingStat;
18
- exports.initialTreeLoadingStat = sync.initialTreeLoadingStat;
19
- exports.loadTreeState = sync.loadTreeState;
20
- exports.PlError = accessors.PlError;
21
- exports.PlTreeEntry = accessors.PlTreeEntry;
22
- exports.PlTreeEntryAccessor = accessors.PlTreeEntryAccessor;
23
- exports.PlTreeNodeAccessor = accessors.PlTreeNodeAccessor;
24
- exports.isPlTreeEntry = accessors.isPlTreeEntry;
25
- exports.isPlTreeEntryAccessor = accessors.isPlTreeEntryAccessor;
26
- exports.isPlTreeNodeAccessor = accessors.isPlTreeNodeAccessor;
27
- exports.treeEntryToResourceInfo = accessors.treeEntryToResourceInfo;
28
- exports.makeResourceSnapshot = snapshot.makeResourceSnapshot;
29
- exports.rsSchema = snapshot.rsSchema;
30
- exports.treeEntryToResourceWithData = snapshot.treeEntryToResourceWithData;
31
- exports.treeEntryToResourceWithMetadata = snapshot.treeEntryToResourceWithMetadata;
32
- exports.SynchronizedTreeState = synchronized_tree.SynchronizedTreeState;
33
- exports.mapValueAndError = value_and_error.mapValueAndError;
34
- exports.mapValueAndErrorIfDefined = value_and_error.mapValueAndErrorIfDefined;
35
- exports.treeDumpStats = dump.treeDumpStats;
36
- //# sourceMappingURL=index.cjs.map
10
+ exports.PlError = require_accessors.PlError;
11
+ exports.PlTreeEntry = require_accessors.PlTreeEntry;
12
+ exports.PlTreeEntryAccessor = require_accessors.PlTreeEntryAccessor;
13
+ exports.PlTreeNodeAccessor = require_accessors.PlTreeNodeAccessor;
14
+ exports.PlTreeResource = require_state.PlTreeResource;
15
+ exports.PlTreeState = require_state.PlTreeState;
16
+ exports.SynchronizedTreeState = require_synchronized_tree.SynchronizedTreeState;
17
+ exports.TreeStateUpdateError = require_state.TreeStateUpdateError;
18
+ exports.constructTreeLoadingRequest = require_sync.constructTreeLoadingRequest;
19
+ exports.formatTreeLoadingStat = require_sync.formatTreeLoadingStat;
20
+ exports.initialTreeLoadingStat = require_sync.initialTreeLoadingStat;
21
+ exports.isPlTreeEntry = require_accessors.isPlTreeEntry;
22
+ exports.isPlTreeEntryAccessor = require_accessors.isPlTreeEntryAccessor;
23
+ exports.isPlTreeNodeAccessor = require_accessors.isPlTreeNodeAccessor;
24
+ exports.loadTreeState = require_sync.loadTreeState;
25
+ exports.makeResourceSnapshot = require_snapshot.makeResourceSnapshot;
26
+ exports.mapValueAndError = require_value_and_error.mapValueAndError;
27
+ exports.mapValueAndErrorIfDefined = require_value_and_error.mapValueAndErrorIfDefined;
28
+ exports.rsSchema = require_snapshot.rsSchema;
29
+ exports.treeDumpStats = require_dump.treeDumpStats;
30
+ exports.treeEntryToResourceInfo = require_accessors.treeEntryToResourceInfo;
31
+ exports.treeEntryToResourceWithData = require_snapshot.treeEntryToResourceWithData;
32
+ exports.treeEntryToResourceWithMetadata = require_snapshot.treeEntryToResourceWithMetadata;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export * from "./traversal_ops";
2
- export * from "./state";
3
- export * from "./sync";
4
- export * from "./accessors";
5
- export * from "./snapshot";
6
- export * from "./synchronized_tree";
7
- export * from "./value_and_error";
8
- export * from "./value_or_error";
9
- export * from "./dump";
10
- //# sourceMappingURL=index.d.ts.map
1
+ import { CommonFieldTraverseOps, CommonTraversalOps, FieldTraversalStep, GetFieldStep, ResourceTraversalOps } from "./traversal_ops.js";
2
+ import { ValueAndError, mapValueAndError, mapValueAndErrorIfDefined } from "./value_and_error.js";
3
+ import { ValueOrError } from "./value_or_error.js";
4
+ import { PlError, PlTreeEntry, PlTreeEntryAccessor, PlTreeNodeAccessor, ResourceInfo, TreeAccessorData, TreeAccessorInstanceData, isPlTreeEntry, isPlTreeEntryAccessor, isPlTreeNodeAccessor, treeEntryToResourceInfo } from "./accessors.js";
5
+ import { ExtendedResourceData, PlTreeResource, PlTreeState, ResourceDataWithFinalState, TreeStateUpdateError } from "./state.js";
6
+ import { PruningFunction, TreeLoadingRequest, TreeLoadingStat, constructTreeLoadingRequest, formatTreeLoadingStat, initialTreeLoadingStat, loadTreeState } from "./sync.js";
7
+ import { InferSnapshot, ResourceSnapshot, ResourceSnapshotSchema, ResourceWithData, ResourceWithMetadata, makeResourceSnapshot, rsSchema, treeEntryToResourceWithData, treeEntryToResourceWithMetadata } from "./snapshot.js";
8
+ import { SynchronizedTreeOps, SynchronizedTreeState } from "./synchronized_tree.js";
9
+ import { ResourceStats, TreeDumpStats, treeDumpStats } from "./dump.js";
10
+ export { CommonFieldTraverseOps, CommonTraversalOps, ExtendedResourceData, FieldTraversalStep, GetFieldStep, InferSnapshot, PlError, PlTreeEntry, PlTreeEntryAccessor, PlTreeNodeAccessor, PlTreeResource, PlTreeState, PruningFunction, ResourceDataWithFinalState, ResourceInfo, ResourceSnapshot, ResourceSnapshotSchema, ResourceStats, ResourceTraversalOps, ResourceWithData, ResourceWithMetadata, SynchronizedTreeOps, SynchronizedTreeState, TreeAccessorData, TreeAccessorInstanceData, TreeDumpStats, TreeLoadingRequest, TreeLoadingStat, TreeStateUpdateError, ValueAndError, ValueOrError, constructTreeLoadingRequest, formatTreeLoadingStat, initialTreeLoadingStat, isPlTreeEntry, isPlTreeEntryAccessor, isPlTreeNodeAccessor, loadTreeState, makeResourceSnapshot, mapValueAndError, mapValueAndErrorIfDefined, rsSchema, treeDumpStats, treeEntryToResourceInfo, treeEntryToResourceWithData, treeEntryToResourceWithMetadata };
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
1
- export { PlTreeResource, PlTreeState, TreeStateUpdateError } from './state.js';
2
- export { constructTreeLoadingRequest, formatTreeLoadingStat, initialTreeLoadingStat, loadTreeState } from './sync.js';
3
- export { PlError, PlTreeEntry, PlTreeEntryAccessor, PlTreeNodeAccessor, isPlTreeEntry, isPlTreeEntryAccessor, isPlTreeNodeAccessor, treeEntryToResourceInfo } from './accessors.js';
4
- export { makeResourceSnapshot, rsSchema, treeEntryToResourceWithData, treeEntryToResourceWithMetadata } from './snapshot.js';
5
- export { SynchronizedTreeState } from './synchronized_tree.js';
6
- export { mapValueAndError, mapValueAndErrorIfDefined } from './value_and_error.js';
7
- export { treeDumpStats } from './dump.js';
8
- //# sourceMappingURL=index.js.map
1
+ import { mapValueAndError, mapValueAndErrorIfDefined } from "./value_and_error.js";
2
+ import { PlError, PlTreeEntry, PlTreeEntryAccessor, PlTreeNodeAccessor, isPlTreeEntry, isPlTreeEntryAccessor, isPlTreeNodeAccessor, treeEntryToResourceInfo } from "./accessors.js";
3
+ import { PlTreeResource, PlTreeState, TreeStateUpdateError } from "./state.js";
4
+ import { constructTreeLoadingRequest, formatTreeLoadingStat, initialTreeLoadingStat, loadTreeState } from "./sync.js";
5
+ import { makeResourceSnapshot, rsSchema, treeEntryToResourceWithData, treeEntryToResourceWithMetadata } from "./snapshot.js";
6
+ import { SynchronizedTreeState } from "./synchronized_tree.js";
7
+ import { treeDumpStats } from "./dump.js";
8
+
9
+ export { PlError, PlTreeEntry, PlTreeEntryAccessor, PlTreeNodeAccessor, PlTreeResource, PlTreeState, SynchronizedTreeState, TreeStateUpdateError, constructTreeLoadingRequest, formatTreeLoadingStat, initialTreeLoadingStat, isPlTreeEntry, isPlTreeEntryAccessor, isPlTreeNodeAccessor, loadTreeState, makeResourceSnapshot, mapValueAndError, mapValueAndErrorIfDefined, rsSchema, treeDumpStats, treeEntryToResourceInfo, treeEntryToResourceWithData, treeEntryToResourceWithMetadata };