@colyseus/schema 2.0.13 → 2.0.15

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.
@@ -695,6 +695,9 @@ class ArraySchema {
695
695
  [Symbol.iterator]() {
696
696
  return Array.from(this.$items.values())[Symbol.iterator]();
697
697
  }
698
+ static get [Symbol.species]() {
699
+ return ArraySchema;
700
+ }
698
701
  // WORKAROUND for compatibility
699
702
  // - TypeScript 4 defines @@unscopables as a function
700
703
  // - TypeScript 5 defines @@unscopables as an object
@@ -866,6 +869,9 @@ class MapSchema {
866
869
  /** Iterator */
867
870
  [Symbol.iterator]() { return this.$items[Symbol.iterator](); }
868
871
  get [Symbol.toStringTag]() { return this.$items[Symbol.toStringTag]; }
872
+ static get [Symbol.species]() {
873
+ return MapSchema;
874
+ }
869
875
  set(key, value) {
870
876
  if (value === undefined || value === null) {
871
877
  throw new Error(`MapSchema#set('${key}', ${value}): trying to set ${value} value on '${key}'.`);
@@ -2939,7 +2945,7 @@ class Schema {
2939
2945
  if (!uniqueRefIds.has(refId)) {
2940
2946
  try {
2941
2947
  // trigger onChange
2942
- $callbacks?.[OPERATION.REPLACE]?.forEach(callback => callback(changes));
2948
+ $callbacks?.[OPERATION.REPLACE]?.forEach(callback => callback());
2943
2949
  }
2944
2950
  catch (e) {
2945
2951
  Schema.onError(e);