@singularsystems/neo-core 1.6.2 → 1.6.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Neo core changelog
2
2
 
3
+ ## Version 1.6.3 (20 July 2026)
4
+
5
+ - Fixed issue with `Utils.createInstance` not passing parameters correctly.
6
+
3
7
  ## Version 1.6.2 (10 July 2026)
4
8
 
5
9
  - PageManager
@@ -197,15 +197,16 @@ var NeoTypeInfo = /** @class */ (function () {
197
197
  }
198
198
  };
199
199
  NeoTypeInfo.prototype.createInstance = function () {
200
+ var _a;
200
201
  var args = [];
201
202
  for (var _i = 0; _i < arguments.length; _i++) {
202
203
  args[_i] = arguments[_i];
203
204
  }
204
205
  if (this.wrapperConstructor) {
205
- return this.wrapperConstructor(args);
206
+ return this.wrapperConstructor.apply(this, args);
206
207
  }
207
208
  else {
208
- return new this.objectConstructor(args);
209
+ return new ((_a = this.objectConstructor).bind.apply(_a, __spreadArray([void 0], args, false)))();
209
210
  }
210
211
  };
211
212
  /** Gets the override constructor which can setup a neo model. */
package/dist/Utils.d.ts CHANGED
@@ -45,7 +45,7 @@ export declare class Utils {
45
45
  static sameTypes(type1: Function, type2: Function): boolean;
46
46
  static getTypeName(type: Function): string;
47
47
  /**
48
- * Creates an instance of a model decorated with @NeoModel. Use this in static methods on a model class that is compiled with babel (React projects).
48
+ * Creates an instance of a neo model decorated with @NeoModel. Use this in static methods on a model class that is compiled with babel (React projects).
49
49
  * @param type Type to create.
50
50
  * @param args Constructor args.
51
51
  */
package/dist/Utils.js CHANGED
@@ -78,20 +78,21 @@ var Utils = /** @class */ (function () {
78
78
  return (_a = constructor.typeName) !== null && _a !== void 0 ? _a : constructor.name;
79
79
  };
80
80
  /**
81
- * Creates an instance of a model decorated with @NeoModel. Use this in static methods on a model class that is compiled with babel (React projects).
81
+ * Creates an instance of a neo model decorated with @NeoModel. Use this in static methods on a model class that is compiled with babel (React projects).
82
82
  * @param type Type to create.
83
83
  * @param args Constructor args.
84
84
  */
85
85
  Utils.createInstance = function (type) {
86
+ var _a;
86
87
  var args = [];
87
88
  for (var _i = 1; _i < arguments.length; _i++) {
88
89
  args[_i - 1] = arguments[_i];
89
90
  }
90
91
  if (type.prototype.constructor.neo) {
91
- return ensureTypeInfo(type).neo.createInstance(args);
92
+ return (_a = ensureTypeInfo(type).neo).createInstance.apply(_a, args);
92
93
  }
93
94
  else {
94
- throw "Cannot instantiate '".concat(type.name, "' because it does not have an @NeoModel attribute.");
95
+ throw "Cannot instantiate '".concat(type.name, "' because it does not call this.makeBindable(), or this.makeObservable().");
95
96
  }
96
97
  };
97
98
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-core",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "Core functionality for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",