Skip to content

Commit

Permalink
Don't stringify and parse the error object to and from json (#22)
Browse files Browse the repository at this point in the history
Stringifying and parsing again will throw when `obj` has a circular
structure which can exist when e.g. ember data relationships are values
in the changesets underlying object. Fixes #19
  • Loading branch information
ohcibi authored Mar 21, 2020
1 parent b232673 commit d5ff4de
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ export class BufferedChangeset implements IChangeset {
}

get error() {
let obj: Errors<any> = this[ERRORS];
// TODO: whyy?
return JSON.parse(JSON.stringify(obj));
return this[ERRORS];
}

get data() {
Expand Down

0 comments on commit d5ff4de

Please sign in to comment.