@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.
@@ -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, pack) {
44
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
45
- if (ar || !(i in from)) {
46
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
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
  /*