Socket
Socket
Sign inDemoInstall

typescript-json-serializer

Package Overview
Dependencies
2
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
234567Next

6.0.1

Diff

gillianperard
published 6.0.0 •

Changelog

Source

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)

<a name="5.1.0"></a>

gillianperard
published 5.1.0 •

Changelog

Source

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)

<a name="5.0.0"></a>

gillianperard
published 5.0.0 •

Changelog

Source

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)

<a name="4.3.0"></a>

gillianperard
published 4.3.0 •

Changelog

Source

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)

<a name="4.2.0"></a>

gillianperard
published 4.2.0 •

Changelog

Source

4.2.0 (2022-05-20)

Features

<a name="4.1.1"></a>

gillianperard
published 4.1.1 •

Changelog

Source

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)

<a name="4.1.0"></a>

gillianperard
published 4.1.0 •

Changelog

Source

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)

<a name="4.0.1"></a>

gillianperard
published 4.0.1 •

Changelog

Source

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)

<a name="4.0.0"></a>

gillianperard
published 4.0.0 •

Changelog

Source

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)

<a name="3.4.5"></a>

234567Next
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc