Skip to content

Latest commit

 

History

History
446 lines (262 loc) · 23.1 KB

CHANGELOG.md

File metadata and controls

446 lines (262 loc) · 23.1 KB

6.0.1 (2023-06-07)

Fixes

  • deps: bump minimatch from 3.0.4 to 3.1.2 (#203) (108de56)
  • JsonSerializer: deserialize and serialize dictionary (map) having array as value (#208) (1c41836)

6.0.0 (2023-03-29)

Check the new README to understand how to use typescript-json-serializer now.

BREAKING CHANGES

  • JsonObject: empty object {} is no longer passed to the constructor on deserialize. This list of default params must be pass to the JsonObject thanks to the new constructorParams property of the JsonObjectOptions if the class contains a constructor with params used in the constructor body.

Fixes

  • deps: bump json5 from 2.2.0 to 2.2.3 (#196) (63d941d)
  • JsonObject: JsonObjectOptions has been added to manage default constructor params values (#200) (8f9eba8)
  • JsonSerializer: take in account the default value of properties when it checks if the value is required (#201) (136ed86)

5.1.0 (2022-11-01)

Features

  • JsonObjectOptions: additionalPropertiesPolicy option has been added to define what is the policy when the algorithm meet an additional property, the 3 choices are allow, disallow and remove (#186) (07284ef)

5.0.0 (2022-10-08)

Check the new README to understand how to use typescript-json-serializer now.

BREAKING CHANGES

  • JsonProperty:
    • isDictionary argument has been removed, now you can use the dataStructure argument

Features

  • JsonProperty: dataStructure argument has been added to manage array, dictionary, map and set (#185) (ace015f)

Fixes

  • SerializeObject: check required properties (#187) (136ed86)

4.3.0 (2022-08-17)

Features

  • JsonSerializer: add support for Map and Set types (#181) (5a5ee26)

(special thanks to @THUzxj)

Bug fixes

  • deps: bump terser from 5.7.1 to 5.14.2 (#179) (861f182)

4.2.0 (2022-05-20)

Features

4.1.1 (2022-04-12)

Bug fixes

  • deps: bump minimist from 1.2.5 to 1.2.6 (345349c)
  • deps: bump ansi-regex from 4.1.0 to 4.1.1 (d8c5310)

4.1.0 (2022-04-08)

Features

  • deserialize: support to deserialize using instance of type (#170) (f4d33f9)
  • deserializeObject: support to deserialize using instance of type (#170) (f4d33f9)
  • deserializeObjectArray: support to deserialize using instance of type (#170) (f4d33f9)

(special thanks to @dhkatz)

4.0.1 (2022-03-11)

Bug fixes

  • JsonSerializer: apply properly NullishPolicy validation (#167) (8faa6ae)
  • deps: bump trim-off-newlines from 1.0.1 to 1.0.3 (8786244)

4.0.0 (2022-02-15)

New major version comes with lot of breaking changes detailed below.
The purpose was to reorganize the entire project, write more tests and above all improve the usage of the library.

Check the new README to understand how to use typescript-json-serializer now.

BREAKING CHANGES

  • Serializable:
    • the decorator was renamed to JsonObject to be more consistent
    • formatPropertyNames option has been moved to the new JsonSerializerOptions class.
  • JsonProperty:
    • predicate argument has been removed, now you can use the type argument
    • names argument has been removed, now you can use the name argument
  • serialize function has been moved to the new JsonSerializer class
  • deserialize function has been moved to the new JsonSerializer class

Build

  • replace tsc by rollup for types generation (ca9f08)
  • bump tmpl from version 1.0.4 to 1.0.5

Features

  • JsonSerializer: new class was added to handle all the logic about serialization and deserialization (bcc49e)
  • JsonSerializerOptions: new class was added to handle all the JsonSerializer options as (bcc49e)
    • errorCallback: callback you can define to handle the errors, by default the library comes with 2 predefined callback logError and throwError but you can define your own
    • nullishPolicy: object to define what is the policy when the algorithm meet a null or an undefined value, the 3 choices are allow, disallow and remove
    • formatPropertyName: this option has been moved from Serializable decorator and keep the same behavior
  • serializeObject: new method added to JsonSerializer to serialize object only (bcc49e)
  • serializeObjectArray: new method added to JsonSerializer to serialize object object array only (bcc49e)
  • deserializeObject: new method added to JsonSerializer to deserialize object only (bcc49e)
  • deserializeObjectArray: new method added to JsonSerializer to deserialize object object array only (bcc49e)

3.4.5 (2022-01-07)

Bug fixes

  • deserialize: accept object as constructor param for type (#161) (4ab2170)
  • deps: bump tmpl from 1.0.4 to 1.0.5 (05e0fc2)

3.4.4 (2021-07-10)

Bug fixes

  • deps: move tslib from devDependencies to dependencies to avoid the following error: "export '__spreadArray' (imported as 'e') was not found in 'tslib' (#148) (5895ccf)

3.4.3 (2021-07-08)

Refactors

  • getPropertyNames: remove complexity by removing two loops (6dd896a)

3.4.2 (2021-07-02)

Bug fixes

  • getPropertyNames: remove class body before parsing ctor (#145) (6ff839f)

3.4.1 (2021-06-11)

Bug fixes

  • getPropertyNames: improve regex to take in account Angular and React builds (#132) (#135) (8470679)
  • docs: add a section to explain how to use the library with CRA (create-react-app) (#132) (2c0ddbc)

3.4.0 (2021-06-08)

Build

Features

  • deserialize: allow json string as first parameter (#141) (ff06ed1)

3.3.0 (2021-04-20)

Features

3.2.2 (2021-03-18)

Build

  • make the lib work for commonjs and ecmascript project (#129) (37e1bf5)

3.2.1 (2021-03-12)

Bug fixes

  • serialize: preserve the value of the instance on beforeSerialize (#123) (8af4689)

3.2.0 (2021-03-10)

Build

  • add support for EcmaScript, CommonJs and UMD (#125) (2c48030)

3.1.0 (2021-02-25)

Features

3.0.0 (2021-01-22)

Features

  • JsonProperty: add beforeSerialize option (#115) (35d3776)

BREAKING CHANGES

  • onSerialize renamed by afterSerialize
  • onDeserialize renamed by beforeDeserialize
  • postDeserialize renamed by afterDeserialize

2.5.3 (2021-01-21)

Bug fixes

  • getBaseClassNames: merge class maps in the correct order (#115) (5256176)

2.5.2 (2020-11-30)

Features

2.5.1 (2020-11-28)

Bug fixes

  • proto: make IOProto and PredicateProto returning any (#107) (79a531f)

2.5.0 (2020-11-11)

Features

  • Serializable: add formatPropertyNames option (#91) (f2e9f63)

2.4.1 (2020-11-09)

Bug Fixes

  • castSimpleData: handle null type (93bc7b7)

Features

  • JSonProperty: add IOProto and PredicateProto (#98) (4c4dd6f) (special thanks to @sco974)

2.4.0 (2020-08-26)

Features

  • JSonProperty: add support for Dictionary (#94) (81f3ca2)

2.3.4 (2020-08-26)

Bug Fixes

  • deserialize: remove values from instance (#95) (5719bc2)

2.3.3 (2020-07-31)

Bug Fixes

  • security: update lodash (87a5037)

2.3.2 (2020-07-02)

Build

2.3.1 (2020-07-02)

Build

  • add tslib (importHelpers) and remove comments from js files (f739250)

2.3.0 (2020-06-28)

Features

  • deserialize: add possibility to predicate an union type composed by custom classes and primitive types (#80) (57d7f22)

2.2.1 (2020-06-27)

Bug Fixes

2.2.0 (2020-05-17)

Features

  • JsonProperty: add postDeserialize option (#77) (f9e47f6)

2.1.0 (2020-05-01)

Bug Fixes

  • castSimpleData: test if data is not null or undefined before using toString method (#73) (efb0574)

Features

  • JsonProperty: add names option that allows the merge of some properties (#72) (f590cf7)

2.0.0 (2020-04-18)

Build

  • create specific tsconfig build file (acbf02c)

Features

  • Serializable: add support for deep inheritance (#64) (c89bb3a)

1.4.6 (2020-04-15)

Build

  • only build the src folder (768cfa2)

1.4.5 (2020-03-15)

Bug Fixes

  • deserialize: empty child class now has parent properties (#58) (86f89c2)

1.4.4 (2020-01-31)

Bug Fixes

  • getParamNames: improve constructor parameter pattern (#55) (a9e2a74) (special thanks to @jiripudil)

1.4.3 (2020-01-30)

Bug Fixes

  • convertPropertyToData: manage undefined property (#53) (f31bf2f) (special thanks to @fullc0de)

1.4.2 (2019-11-19)

Bug Fixes

  • convertPropertyToData: test if a date is undefined or null before using toISOString method (#50) (8d5d9cf)
  • deserialize: set first parameter type to object to avoid runtime error (1ae3531)
  • security: update set-value (7d07007)

1.4.1 (2019-11-17)

Bug fixes

  • docs: remove useless generics for deserialize function (#45) (4c76893)

1.4.0 (2019-11-16)

Features

  • JsonProperty: add onDeserialize and OnSerialize options (#45) (d527290)

1.3.0 (2019-07-20)

Features

  • deserialize: add generic type (a0689eb)

1.2.5 (2019-07-02)

Bug Fixes

  • getParamNames: retrieve constructor param names from minified code (#36) (14f2140) (special thanks to @civilizeddev)

1.2.4 (2019-06-21)

Bug Fixes

1.2.3 (2019-06-20)

Bug Fixes

  • getParamNames: exclude simple comments from constructor parsing (#33) (ad85984) (special thanks to @civilizeddev)

1.2.2 (2019-06-19)

  • getParamNames: get constructor properties (e4ba74f)

1.2.0 (2019-06-14)

Features

  • JsonProperty: add support for using it directly inside constructor (#28) (fe3d92d)

1.1.0 (2019-04-21)

Features

  • JsonProperty: add predicate option (#19) (4a67bc0)