Tags: teq/serialazy
Tags
* **[BREAKING]** Removed `@Serialize.Type()` and `@Serialize.Custom()… …` decorators. Now all type and property decoration is done by `@Serialize()`. * **[BREAKING]** `@Serialize()` accepts custom type serializer (`up` & `down`) and options as a single argument. * **[BREAKING]** Removed `TypeSerializer.discriminate()` (redundant, was never used) * Add `Serializable`, an abstract base class for serializables * Async serialization / deserialization (`deflate.resolve` and `inflate.resolve`) * Serializatio / deserialization to/from a POJO (`as` and `toPojo` options) * Add projections (`projection` and `fallbackToDefaultProjection` options) * Add optional `as` parameter to DeflateOptions. It allows to override a type of serializable (serialize as a different type) * Add options for `inflate` / `deflate`, pass them to `up` / `down` functions as second argument * Both `up` and `down` functions for custom type serializer are now optional
* Added `@Serialize.Type()` decorator which allows to define custom s… …erializers for types * `deflate/inflate` can accept primitives (string, number, boolean and their "boxed" variants, null, undefined) * [BREAKING] Removed `isSerializable`, `deepMerge` facade functions and `@Serialize.Skip()` decorator.
* Added `assertSerializable` functions which throws an error if targe… …t is not serializable class instance or serializable class constructor function (TODO: add example to README). * Previously to be _serializable_ class should have serializers on its own properties (i.e. should have own metadata) with no respect to its ancestors. Now class is _serializable_ if it either has own serializers or any of its ancestors have serializers. * Using global symbol to access serializable's metadata. This fixes a bug when project dependencies introduce multiple instances of library and metadata defined in one verion can't be accessed in another.
v1.3.0 ------ * Added `deepMerge` function which performs a deep (recursive) property merge from serializable-like source object to serializable destination object (TODO: add example to README) * Added `isSerializable` function which allows to check if target is a serializable class instance or serializable class constructor function * Added class name to serialization/deserialization error message
PreviousNext