@luminix/core 1.0.1 → 1.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.
Files changed (2) hide show
  1. package/dist/core.js +4 -4
  2. package/package.json +1 -1
package/dist/core.js CHANGED
@@ -321,11 +321,11 @@ class N {
321
321
  throw new w("Relation.constructor()", "Model, Collection<Model> or null");
322
322
  }
323
323
  make(e) {
324
- const t = this.getRelated();
325
324
  if (e === null || typeof e > "u") {
326
325
  this.set(null);
327
326
  return;
328
327
  }
328
+ const t = this.getRelated();
329
329
  if (this.isSingle()) {
330
330
  if (typeof e != "object" || Array.isArray(e))
331
331
  throw new TypeError("Relation.make() expects an object");
@@ -501,8 +501,6 @@ function Se(o, e, t, r, i) {
501
501
  };
502
502
  if (this.fillable.filter(v).forEach((f) => {
503
503
  d[f] = null;
504
- }), n && Object.keys(n).forEach((f) => {
505
- this.relation(y.camel(f)).make(s[f]);
506
504
  }), !this.validateJsonObject(d)) {
507
505
  if (o.get("app.env", "production") === "production")
508
506
  throw new TypeError(`[Luminix] Invalid attributes for model "${i}"`);
@@ -512,7 +510,9 @@ function Se(o, e, t, r, i) {
512
510
  abstract: i
513
511
  });
514
512
  }
515
- this._attributes.set(".", d), this._original = d, this._changedKeys.splice(0, this._changedKeys.length);
513
+ this._attributes.set(".", d), this._original = d, this._changedKeys.splice(0, this._changedKeys.length), n && Object.keys(n).forEach((f) => {
514
+ this.relation(y.camel(f)).make(s[f]);
515
+ });
516
516
  }
517
517
  makePrimaryKeyReplacer() {
518
518
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminix/core",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "main": "dist/core.js",
5
5
  "module": "dist/core.js",
6
6
  "types": "types/index.d.ts",