Skip to content

Commit 41fd1b7

Browse files
committed
chore: in_memory clone fix
1 parent 2a09140 commit 41fd1b7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/entity/in_memory.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class InMemoryEntity {
9090
*/
9191
validate() {
9292
if (this.schema) {
93-
this.schema.validate(this.toJSONSafe());
93+
this.schema.validate(this.toJSON());
9494
}
9595
}
9696

@@ -103,10 +103,12 @@ export class InMemoryEntity {
103103

104104
isValid() {
105105
const ctx = this.schema.newContext();
106-
ctx.validate(this.toJSONSafe());
106+
const json = this.toJSON();
107+
108+
ctx.validate(json);
107109

108110
if (!ctx.isValid()) {
109-
console.log(JSON.stringify(this.toJSONSafe()));
111+
console.log(JSON.stringify(json));
110112
if (ctx.getErrorObject) {
111113
console.log(ctx.getErrorObject());
112114
}

0 commit comments

Comments
 (0)