@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.
- package/build/cjs/index.js +10 -3
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +10 -3
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +10 -3
- package/lib/Reflection.js.map +1 -1
- package/lib/Schema.d.ts +8 -1
- package/lib/Schema.js +10 -3
- package/lib/Schema.js.map +1 -1
- package/lib/types/custom/MapSchema.d.ts +14 -14
- package/lib/types/custom/MapSchema.js.map +1 -1
- package/package.json +1 -1
- package/src/Reflection.ts +1 -2
- package/src/Schema.ts +10 -3
- package/src/types/custom/MapSchema.ts +12 -12
package/build/esm/index.mjs
CHANGED
|
@@ -3212,13 +3212,20 @@ class Schema {
|
|
|
3212
3212
|
const metadata = this.constructor[Symbol.metadata];
|
|
3213
3213
|
this[metadata[index].name] = undefined;
|
|
3214
3214
|
}
|
|
3215
|
-
|
|
3215
|
+
/**
|
|
3216
|
+
* Inspect the `refId` of all Schema instances in the tree. Optionally display the contents of the instance.
|
|
3217
|
+
*
|
|
3218
|
+
* @param instance Schema instance
|
|
3219
|
+
* @param showContents display JSON contents of the instance
|
|
3220
|
+
* @returns
|
|
3221
|
+
*/
|
|
3222
|
+
static debugRefIds(instance, showContents = false, level = 0) {
|
|
3216
3223
|
const ref = instance;
|
|
3217
3224
|
const changeTree = ref[$changes];
|
|
3218
|
-
const contents = (
|
|
3225
|
+
const contents = (showContents) ? ` - ${JSON.stringify(ref.toJSON())}` : "";
|
|
3219
3226
|
let output = "";
|
|
3220
3227
|
output += `${getIndent(level)}${ref.constructor.name} (refId: ${ref[$changes].refId})${contents}\n`;
|
|
3221
|
-
changeTree.forEachChild((childChangeTree) => output += this.debugRefIds(childChangeTree.ref,
|
|
3228
|
+
changeTree.forEachChild((childChangeTree) => output += this.debugRefIds(childChangeTree.ref, showContents, level + 1));
|
|
3222
3229
|
return output;
|
|
3223
3230
|
}
|
|
3224
3231
|
/**
|