@colyseus/schema 2.0.0 → 2.0.2

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.
@@ -1190,6 +1190,9 @@ function type(type, options) {
1190
1190
  var context = options.context || globalContext;
1191
1191
  var constructor = target.constructor;
1192
1192
  constructor._context = context;
1193
+ if (!type) {
1194
+ throw new Error(constructor.name + ": @type() reference provided for \"" + field + "\" is undefined. Make sure you don't have any circular dependencies.");
1195
+ }
1193
1196
  /*
1194
1197
  * static schema
1195
1198
  */
@@ -3031,7 +3034,7 @@ var Schema = /** @class */ (function () {
3031
3034
  }
3032
3035
  }
3033
3036
  try {
3034
- (_e = $callbacks[change.field]) === null || _e === void 0 ? void 0 : _e.forEach(function (callback) {
3037
+ (_e = $callbacks[change.op]) === null || _e === void 0 ? void 0 : _e.forEach(function (callback) {
3035
3038
  return callback(change.value, change.previousValue);
3036
3039
  });
3037
3040
  }