@ztimson/momentum 1.5.8 → 1.5.9

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
@@ -239,30 +239,37 @@
239
239
  if (type == "function") return target.toString() == values.toString();
240
240
  return target == values;
241
241
  }
242
- function isEqual(a, b, seen = /* @__PURE__ */ new WeakMap()) {
243
- if (a === b) return true;
244
- if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime();
245
- if (a instanceof RegExp && b instanceof RegExp) return a.source === b.source && a.flags === b.flags;
246
- if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) {
247
- if (Number.isNaN(a) && Number.isNaN(b)) return true;
248
- if (typeof a === "function" && typeof b === "function") return a.toString() === b.toString();
249
- return false;
250
- }
251
- if (seen.has(a)) return seen.get(a) === b;
252
- seen.set(a, b);
253
- const isArrayA = Array.isArray(a);
254
- const isArrayB = Array.isArray(b);
255
- if (isArrayA && isArrayB) {
256
- if (a.length !== b.length) return false;
257
- for (let i = 0; i < a.length; i++) if (!isEqual(a[i], b[i], seen)) return false;
242
+ function isEqual(a, b, compare) {
243
+ const eq = (a2, b2, compare2, seen, path) => {
244
+ if (Array.isArray(compare2)) {
245
+ if (compare2.some((p) => new RegExp(`^${p.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^.]*")}(\\.|$)`).test(path))) return true;
246
+ } else if (typeof compare2 === "function") {
247
+ const r = compare2(path, a2, b2);
248
+ if (r !== void 0) return r;
249
+ }
250
+ if (a2 === b2) return true;
251
+ if (a2 instanceof Date && b2 instanceof Date) return a2.getTime() === b2.getTime();
252
+ if (a2 instanceof RegExp && b2 instanceof RegExp) return a2.source === b2.source && a2.flags === b2.flags;
253
+ if (typeof a2 !== "object" || a2 === null || typeof b2 !== "object" || b2 === null) {
254
+ if (Number.isNaN(a2) && Number.isNaN(b2)) return true;
255
+ if (typeof a2 === "function" && typeof b2 === "function") return a2.toString() === b2.toString();
256
+ return false;
257
+ }
258
+ if (seen.has(a2)) return seen.get(a2) === b2;
259
+ seen.set(a2, b2);
260
+ const isArrayA = Array.isArray(a2), isArrayB = Array.isArray(b2);
261
+ if (isArrayA && isArrayB) {
262
+ if (a2.length !== b2.length) return false;
263
+ for (let i = 0; i < a2.length; i++) if (!eq(a2[i], b2[i], compare2, seen, path ? `${path}.${i}` : `${i}`)) return false;
264
+ return true;
265
+ }
266
+ if (isArrayA !== isArrayB) return false;
267
+ const keysA = Object.keys(a2), keysB = Object.keys(b2);
268
+ if (keysA.length !== keysB.length) return false;
269
+ for (const key of keysA) if (!Object.prototype.hasOwnProperty.call(b2, key) || !eq(a2[key], b2[key], compare2, seen, path ? `${path}.${key}` : key)) return false;
258
270
  return true;
259
- }
260
- if (isArrayA !== isArrayB) return false;
261
- const keysA = Object.keys(a);
262
- const keysB = Object.keys(b);
263
- if (keysA.length !== keysB.length) return false;
264
- for (const key of keysA) if (!Object.prototype.hasOwnProperty.call(b, key) || !isEqual(a[key], b[key], seen)) return false;
265
- return true;
271
+ };
272
+ return eq(a, b, compare, /* @__PURE__ */ new WeakMap(), "");
266
273
  }
267
274
  var ASet = class ASet extends Array {
268
275
  /** Number of elements in set */
@@ -5141,7 +5148,7 @@ ${Object.entries(t).map(([name, value]) => `--theme-${kebabCase(name)}: ${value}
5141
5148
  };
5142
5149
  //#endregion
5143
5150
  //#region package.json
5144
- var version = "1.5.8";
5151
+ var version = "1.5.9";
5145
5152
  //#endregion
5146
5153
  //#region src/webRtc.ts
5147
5154
  var WebRtc = class extends PathEventEmitter {
package/dist/index.mjs CHANGED
@@ -235,30 +235,37 @@ function includes(target, values, allowMissing = false) {
235
235
  if (type == "function") return target.toString() == values.toString();
236
236
  return target == values;
237
237
  }
238
- function isEqual(a, b, seen = /* @__PURE__ */ new WeakMap()) {
239
- if (a === b) return true;
240
- if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime();
241
- if (a instanceof RegExp && b instanceof RegExp) return a.source === b.source && a.flags === b.flags;
242
- if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) {
243
- if (Number.isNaN(a) && Number.isNaN(b)) return true;
244
- if (typeof a === "function" && typeof b === "function") return a.toString() === b.toString();
245
- return false;
246
- }
247
- if (seen.has(a)) return seen.get(a) === b;
248
- seen.set(a, b);
249
- const isArrayA = Array.isArray(a);
250
- const isArrayB = Array.isArray(b);
251
- if (isArrayA && isArrayB) {
252
- if (a.length !== b.length) return false;
253
- for (let i = 0; i < a.length; i++) if (!isEqual(a[i], b[i], seen)) return false;
238
+ function isEqual(a, b, compare) {
239
+ const eq = (a2, b2, compare2, seen, path) => {
240
+ if (Array.isArray(compare2)) {
241
+ if (compare2.some((p) => new RegExp(`^${p.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^.]*")}(\\.|$)`).test(path))) return true;
242
+ } else if (typeof compare2 === "function") {
243
+ const r = compare2(path, a2, b2);
244
+ if (r !== void 0) return r;
245
+ }
246
+ if (a2 === b2) return true;
247
+ if (a2 instanceof Date && b2 instanceof Date) return a2.getTime() === b2.getTime();
248
+ if (a2 instanceof RegExp && b2 instanceof RegExp) return a2.source === b2.source && a2.flags === b2.flags;
249
+ if (typeof a2 !== "object" || a2 === null || typeof b2 !== "object" || b2 === null) {
250
+ if (Number.isNaN(a2) && Number.isNaN(b2)) return true;
251
+ if (typeof a2 === "function" && typeof b2 === "function") return a2.toString() === b2.toString();
252
+ return false;
253
+ }
254
+ if (seen.has(a2)) return seen.get(a2) === b2;
255
+ seen.set(a2, b2);
256
+ const isArrayA = Array.isArray(a2), isArrayB = Array.isArray(b2);
257
+ if (isArrayA && isArrayB) {
258
+ if (a2.length !== b2.length) return false;
259
+ for (let i = 0; i < a2.length; i++) if (!eq(a2[i], b2[i], compare2, seen, path ? `${path}.${i}` : `${i}`)) return false;
260
+ return true;
261
+ }
262
+ if (isArrayA !== isArrayB) return false;
263
+ const keysA = Object.keys(a2), keysB = Object.keys(b2);
264
+ if (keysA.length !== keysB.length) return false;
265
+ for (const key of keysA) if (!Object.prototype.hasOwnProperty.call(b2, key) || !eq(a2[key], b2[key], compare2, seen, path ? `${path}.${key}` : key)) return false;
254
266
  return true;
255
- }
256
- if (isArrayA !== isArrayB) return false;
257
- const keysA = Object.keys(a);
258
- const keysB = Object.keys(b);
259
- if (keysA.length !== keysB.length) return false;
260
- for (const key of keysA) if (!Object.prototype.hasOwnProperty.call(b, key) || !isEqual(a[key], b[key], seen)) return false;
261
- return true;
267
+ };
268
+ return eq(a, b, compare, /* @__PURE__ */ new WeakMap(), "");
262
269
  }
263
270
  var ASet = class ASet extends Array {
264
271
  /** Number of elements in set */
@@ -5137,7 +5144,7 @@ var Static = class extends Storage {
5137
5144
  };
5138
5145
  //#endregion
5139
5146
  //#region package.json
5140
- var version = "1.5.8";
5147
+ var version = "1.5.9";
5141
5148
  //#endregion
5142
5149
  //#region src/webRtc.ts
5143
5150
  var WebRtc = class extends PathEventEmitter {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztimson/momentum",
3
- "version": "1.5.8",
3
+ "version": "1.5.9",
4
4
  "description": "Client library for momentum",
5
5
  "keywords": [
6
6
  "Momentum"
@@ -33,7 +33,7 @@
33
33
  "postbuild": "npm run build:docs && node -e \"const fs=require('fs');fs.cpSync('dist/index.mjs','../server/public/momentum.mjs');fs.cpSync('dist/index.js','../server/public/momentum.js');fs.cpSync('dist/momentum.worker.mjs','../server/public/momentum.worker.mjs')\""
34
34
  },
35
35
  "dependencies": {
36
- "@ztimson/utils": "^0.30.10"
36
+ "@ztimson/utils": "^0.31.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^26.1.1",