@signaltree/enterprise 11.5.3 → 12.0.0

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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { ChangeType, DiffEngine } from './lib/diff-engine.js';
2
2
  export { PathIndex } from './lib/path-index.js';
3
3
  export { OptimizedUpdateEngine } from './lib/update-engine.js';
4
- export { enterprise, withEnterprise } from './lib/enterprise-enhancer.js';
4
+ export { enterprise } from './lib/enterprise-enhancer.js';
5
5
  export { configureScheduler, getSchedulerMetrics, postTask } from './lib/scheduler.js';
6
6
  export { createMockPool } from './lib/thread-pools.js';
@@ -1,3 +1,5 @@
1
+ import { isBuiltInObject } from '@signaltree/core';
2
+
1
3
  var ChangeType;
2
4
  (function (ChangeType) {
3
5
  ChangeType["ADD"] = "add";
@@ -49,7 +51,7 @@ class DiffEngine {
49
51
  if (curr === upd) {
50
52
  return;
51
53
  }
52
- if (typeof upd !== 'object' || upd === null) {
54
+ if (typeof upd !== 'object' || upd === null || isBuiltInObject(upd)) {
53
55
  if (!opts.equalityFn(curr, upd)) {
54
56
  changes.push({
55
57
  type: curr === undefined ? ChangeType.ADD : ChangeType.UPDATE,
@@ -68,6 +68,5 @@ function enterprise(options = {}) {
68
68
  return enhancedTree;
69
69
  };
70
70
  }
71
- const withEnterprise = Object.assign(enterprise, {});
72
71
 
73
- export { enterprise, withEnterprise };
72
+ export { enterprise };
@@ -1,4 +1,5 @@
1
1
  import { isSignal } from '@angular/core';
2
+ import { isTraversableNode } from '@signaltree/core';
2
3
 
3
4
  class TrieNode {
4
5
  constructor() {
@@ -142,7 +143,7 @@ class PathIndex {
142
143
  this.set(path, tree);
143
144
  return;
144
145
  }
145
- if (typeof tree !== 'object' && typeof tree !== 'function') {
146
+ if (!isTraversableNode(tree)) {
146
147
  return;
147
148
  }
148
149
  for (const [key, value] of Object.entries(tree)) {
@@ -1,4 +1,5 @@
1
1
  import { isSignal } from '@angular/core';
2
+ import { isTraversableNode, isBuiltInObject } from '@signaltree/core';
2
3
  import { DiffEngine, ChangeType } from './diff-engine.js';
3
4
  import { PathIndex } from './path-index.js';
4
5
 
@@ -150,13 +151,13 @@ class OptimizedUpdateEngine {
150
151
  for (let i = 0; i < patch.path.length - 1; i++) {
151
152
  const key = patch.path[i];
152
153
  current = current[key];
153
- if (!current || typeof current !== 'object' && typeof current !== 'function') {
154
+ if (!isTraversableNode(current)) {
154
155
  return false;
155
156
  }
156
157
  }
157
158
  const lastKey = patch.path[patch.path.length - 1];
158
159
  const target = current[lastKey];
159
- if (target && (typeof target === 'function' || typeof target === 'object')) {
160
+ if (isTraversableNode(target)) {
160
161
  if (isSignal(target)) {
161
162
  const leaf = target;
162
163
  if (this.isEqual(leaf(), patch.value)) {
@@ -188,7 +189,7 @@ class OptimizedUpdateEngine {
188
189
  leaf.set(value);
189
190
  return true;
190
191
  }
191
- if ((typeof node === 'object' || typeof node === 'function') && value && typeof value === 'object') {
192
+ if (isTraversableNode(node) && value && typeof value === 'object') {
192
193
  let changed = false;
193
194
  for (const [key, child] of Object.entries(value)) {
194
195
  changed = this.applyDeepToNode(node[key], child) || changed;
@@ -202,6 +203,11 @@ class OptimizedUpdateEngine {
202
203
  if (typeof a !== typeof b) return false;
203
204
  if (a === null || b === null) return false;
204
205
  if (typeof a !== 'object') return false;
206
+ if (isBuiltInObject(a) || isBuiltInObject(b)) {
207
+ if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime();
208
+ if (a instanceof RegExp && b instanceof RegExp) return a.source === b.source && a.flags === b.flags;
209
+ return false;
210
+ }
205
211
  const ao = a;
206
212
  const bo = b;
207
213
  if (Array.isArray(ao) && Array.isArray(bo)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signaltree/enterprise",
3
- "version": "11.5.3",
3
+ "version": "12.0.0",
4
4
  "description": "Enterprise optimizations for SignalTree reactive JSON. Diff-based updates, bulk operations, and advanced change tracking for large-scale applications.",
5
5
  "license": "BUSL-1.1",
6
6
  "type": "module",
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@angular/core": "^20.0.0 || ^21.0.0 || ^22.0.0",
71
- "@signaltree/core": "^11.5.3",
71
+ "@signaltree/core": "workspace:*",
72
72
  "tslib": "^2.0.0"
73
73
  },
74
74
  "peerDependenciesMeta": {},
@@ -21,4 +21,3 @@ export interface EnterpriseEnhancedTree<T> {
21
21
  updateAuto(updates: unknown): unknown;
22
22
  getPathIndex(): PathIndex<Signal<unknown>> | null;
23
23
  }
24
- export declare const withEnterprise: typeof enterprise;