@colyseus/schema 1.0.26 → 1.0.30
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 +7 -8
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +84 -110
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +7 -8
- package/lib/annotations.js +3 -0
- package/lib/annotations.js.map +1 -1
- package/lib/changes/ReferenceTracker.d.ts +14 -0
- package/lib/changes/ReferenceTracker.js +77 -0
- package/lib/changes/ReferenceTracker.js.map +1 -0
- package/lib/codegen/languages/ts.js +1 -1
- package/lib/codegen/languages/ts.js.map +1 -1
- package/lib/codegen/types.js +7 -1
- package/lib/codegen/types.js.map +1 -1
- package/lib/types/typeRegistry.d.ts +5 -0
- package/lib/types/typeRegistry.js +13 -0
- package/lib/types/typeRegistry.js.map +1 -0
- package/lib/types/utils.d.ts +9 -0
- package/lib/types/utils.js +50 -0
- package/lib/types/utils.js.map +1 -0
- package/package.json +4 -1
- package/decoders/cpp/usage_array_schema_types.cpp +0 -40
- package/decoders/cpp/usage_child_schema_types.cpp +0 -24
- package/decoders/cpp/usage_inherited_types.cpp +0 -34
- package/decoders/cpp/usage_map_schema_types.cpp +0 -35
- package/decoders/cpp/usage_primitive_types.cpp +0 -41
package/build/cjs/index.js
CHANGED
|
@@ -40,14 +40,10 @@ function __decorate(decorators, target, key, desc) {
|
|
|
40
40
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function __spreadArray(to, from
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
ar[i] = from[i];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return to.concat(ar || from);
|
|
43
|
+
function __spreadArray(to, from) {
|
|
44
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
45
|
+
to[j] = from[i];
|
|
46
|
+
return to;
|
|
51
47
|
}
|
|
52
48
|
|
|
53
49
|
// export const SWITCH_TO_STRUCTURE = 193; (easily collides with DELETE_AND_ADD + fieldIndex = 2)
|
|
@@ -1194,6 +1190,9 @@ var globalContext = new Context();
|
|
|
1194
1190
|
function type(type, context) {
|
|
1195
1191
|
if (context === void 0) { context = globalContext; }
|
|
1196
1192
|
return function (target, field) {
|
|
1193
|
+
if (!type) {
|
|
1194
|
+
throw new Error("Type not found. Ensure your `@type` annotations are correct and that you don't have any circular dependencies.");
|
|
1195
|
+
}
|
|
1197
1196
|
var constructor = target.constructor;
|
|
1198
1197
|
constructor._context = context;
|
|
1199
1198
|
/*
|