@colyseus/schema 3.0.0-alpha.48 → 3.0.0-alpha.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.
@@ -3214,13 +3214,20 @@ class Schema {
3214
3214
  const metadata = this.constructor[Symbol.metadata];
3215
3215
  this[metadata[index].name] = undefined;
3216
3216
  }
3217
- static debugRefIds(instance, jsonContents = true, level = 0) {
3217
+ /**
3218
+ * Inspect the `refId` of all Schema instances in the tree. Optionally display the contents of the instance.
3219
+ *
3220
+ * @param instance Schema instance
3221
+ * @param showContents display JSON contents of the instance
3222
+ * @returns
3223
+ */
3224
+ static debugRefIds(instance, showContents = false, level = 0) {
3218
3225
  const ref = instance;
3219
3226
  const changeTree = ref[$changes];
3220
- const contents = (jsonContents) ? ` - ${JSON.stringify(ref.toJSON())}` : "";
3227
+ const contents = (showContents) ? ` - ${JSON.stringify(ref.toJSON())}` : "";
3221
3228
  let output = "";
3222
3229
  output += `${getIndent(level)}${ref.constructor.name} (refId: ${ref[$changes].refId})${contents}\n`;
3223
- changeTree.forEachChild((childChangeTree) => output += this.debugRefIds(childChangeTree.ref, jsonContents, level + 1));
3230
+ changeTree.forEachChild((childChangeTree) => output += this.debugRefIds(childChangeTree.ref, showContents, level + 1));
3224
3231
  return output;
3225
3232
  }
3226
3233
  /**