@colyseus/schema 3.0.0-alpha.44 → 3.0.0-alpha.47

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.
@@ -659,7 +659,7 @@ class TypeContext {
659
659
  }
660
660
  // add classes inherited from this base class
661
661
  TypeContext.inheritedTypes.get(klass)?.forEach((child) => {
662
- this.discoverTypes(child, klass, parentIndex, parentHasViewTag);
662
+ this.discoverTypes(child, parentType, parentIndex, parentHasViewTag);
663
663
  });
664
664
  // add parent classes
665
665
  let parent = klass;
@@ -1340,16 +1340,16 @@ class ChangeTree {
1340
1340
  return;
1341
1341
  }
1342
1342
  // ArraySchema | MapSchema - get the child type
1343
- const ref = Metadata.isValidInstance(this.ref)
1344
- ? this.ref
1345
- : new this.ref[$childType];
1343
+ const refType = Metadata.isValidInstance(this.ref)
1344
+ ? this.ref.constructor
1345
+ : this.ref[$childType];
1346
1346
  if (!Metadata.isValidInstance(parent)) {
1347
1347
  const parentChangeTree = parent[$changes];
1348
1348
  parent = parentChangeTree.parent;
1349
1349
  parentIndex = parentChangeTree.parentIndex;
1350
1350
  }
1351
1351
  const parentConstructor = parent.constructor;
1352
- let key = `${this.root.types.getTypeId(ref.constructor)}`;
1352
+ let key = `${this.root.types.getTypeId(refType)}`;
1353
1353
  if (parentConstructor) {
1354
1354
  key += `-${this.root.types.schemas.get(parentConstructor)}`;
1355
1355
  }