Skip to content

Commit

Permalink
fixed parent reference
Browse files Browse the repository at this point in the history
  • Loading branch information
massimocandela committed Feb 1, 2022
1 parent 1e261e1 commit ba2c06a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SubObj.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default class SubObj extends BasicObj {
const mmnt = moment(value);
this[key] = mmnt.isValid() ? mmnt : value;
} else if (model.options.deep && typeof(value) === "object" && !Array.isArray(value)){
this[key] = new SubObj(this, value, model);
this[key] = new SubObj(this.#parent, value, model);
} else if (model.options.deep && Array.isArray(value)){
this[key] = value.map(i => new SubObj(this, i, model));
this[key] = value.map(i => new SubObj(this.#parent, i, model));
} else {
this[key] = value;
}
Expand Down

0 comments on commit ba2c06a

Please sign in to comment.