forked from greg9504/ts-json-serializer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TsSerializer.ts - Fix reference object saving order. There is a bug w…
…ith circular references, in typical parent children type lists (treeview). In deserailzeObject the reference wasn't pushed onto the references array until after all properties were recursively processed. This resulted in the wrong references being used. The fix is to first push an undefined object onto the references array, save the index, process the objects properties, then save the newly built object to the references array at the index. base.json - set target to ES2015 so that the Error classes that are subclass of Error have proper typing, see https://stackoverflow.com/questions/41102060/typescript-extending-error-class TsSerializer.spec.ts - Add test case for parent - children type lists. Also make sure any SubModel classes were declared before Model otherwise with target ES2015 would get eferenceError: SubModel is not defined
- Loading branch information
greg
committed
Jun 3, 2018
1 parent
9f0611c
commit cdcf86b
Showing
3 changed files
with
72 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters