Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo Pichilli authored and Lorenzo Pichilli committed May 13, 2020
1 parent 0619b64 commit b9a1be7
Show file tree
Hide file tree
Showing 179 changed files with 32,602 additions and 3,457 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## 1.1.0

- Update bundle dependencies
- Fixed `transform` methods when using Babel compiler
- Added `dateLibrary` option to `@JsonFormat()` and `JsonStringifierContext`
- Added `uuidLibrary` option to `@JsonIdentityInfo()` and `JsonStringifierContext`

### BREAKING CHANGES
- To be able to use `@JsonFormat()` on class properties of type "Date" with `JsonFormatShape.STRING`, a date library needs to be set. Date libraries supported: "https://github.com/moment/moment", "https://github.com/iamkun/dayjs/"
- To be able to use `@JsonIdentityInfo()` with any UUID `ObjectIdGenerator`, an UUID library needs to be set. UUID library supported: "https://github.com/uuidjs/uuid".

## 1.0.0

Initial release
25 changes: 24 additions & 1 deletion dist/@types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,17 @@ export interface JsonStringifierForTypeContext extends JsonStringifierParserComm
* Array of custom user-defined serializers.
*/
serializers?: CustomMapper<Serializer>[];
/**
* To be able to use {@link JsonFormat} on class properties of type `Date`
* with {@link JsonFormatShape.STRING}, a date library needs to be set.
* Date libraries supported: {@link https://github.com/moment/moment}, {@link https://github.com/iamkun/dayjs/}.
*/
dateLibrary?: any;
/**
* To be able to use {@link JsonIdentityInfo} with any UUID {@link ObjectIdGenerator}, an UUID library needs to be set.
* UUID libraries supported: {@link https://github.com/uuidjs/uuid}.
*/
uuidLibrary?: any;
}
/**
* Context properties used by {@link JsonStringifier.stringify} during serialization.
Expand Down Expand Up @@ -523,7 +534,8 @@ export interface JsonFormatScalar extends JsonFormatBaseOptions {
/**
* Decorator specific options for {@link JsonFormat} with {@link JsonFormatBaseOptions.shape} value {@link JsonFormatShape.STRING}.
*
* When formatting a `Date`, the {@link https://github.com/iamkun/dayjs} date library is used.
* **IMPORTANT NOTE**: When formatting a `Date`, a date library needs to be set using the {@link dateLibrary} option.
* Date libraries supported: {@link https://github.com/moment/moment}, {@link https://github.com/iamkun/dayjs/}.
*/
export interface JsonFormatString extends JsonFormatBaseOptions {
/**
Expand All @@ -544,6 +556,12 @@ export interface JsonFormatString extends JsonFormatBaseOptions {
* Timezone to be used to format a `Date` during serialization.
*/
timezone?: string;
/**
* To be able to use {@link JsonFormat} on class properties of type `Date`
* with {@link JsonFormatShape.STRING}, a date library needs to be set.
* Date libraries supported: {@link https://github.com/moment/moment}, {@link https://github.com/iamkun/dayjs/}.
*/
dateLibrary?: any;
/**
* Radix to be used to format an integer `Number` during serialization and using `parseInt()`.
*/
Expand Down Expand Up @@ -942,6 +960,11 @@ export interface JsonIdentityInfoOptions extends JsonDecoratorOptions {
* Options for version 1 UUID Generator (see {@link https://github.com/uuidjs/uuid#version-1-timestamp})
*/
uuidv1?: UUIDv1GeneratorOptions;
/**
* To be able to use {@link JsonIdentityInfo} with any UUID {@link ObjectIdGenerator}, an UUID library needs to be set.
* UUID libraries supported: {@link https://github.com/uuidjs/uuid}.
*/
uuidLibrary?: any;
}
/**
* Decorator options for {@link JsonIdentityReference}.
Expand Down
4 changes: 4 additions & 0 deletions dist/decorators/JsonFormat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export declare enum JsonFormatShape {
*
* Iterables, such as `Array` and `Set`, can be serialized as JSON Objects if {@link JsonFormatShape.OBJECT} is used.
*
* **IMPORTANT NOTE**: To be able to use {@link JsonFormat} on class properties of type `Date`
* with {@link JsonFormatShape.STRING}, a date library needs to be set.
* Date libraries supported: {@link https://github.com/moment/moment}, {@link https://github.com/iamkun/dayjs/}.
*
* @example
* ```typescript
* class Event {
Expand Down
11 changes: 6 additions & 5 deletions dist/decorators/JsonIdentityInfo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
*/
import { JsonIdentityInfoDecorator } from '../@types';
/**
* Generator to use for producing Object Identifier for objects
* Generator to use for producing Object Identifier for objects.
* To be able to use {@link JsonIdentityInfo} with any UUID {@link ObjectIdGenerator}, an UUID library needs to be set.
* UUID library supported: {@link https://github.com/uuidjs/uuid}.
*/
export declare enum ObjectIdGenerator {
/**
Expand All @@ -22,22 +24,18 @@ export declare enum ObjectIdGenerator {
PropertyGenerator = 2,
/**
* Implementation that just uses version 5 UUIDs as reliably unique identifiers.
* UUIDs are generated using the {@link https://github.com/uuidjs/uuid} library.
*/
UUIDv5Generator = 3,
/**
* Implementation that just uses version 4 UUIDs as reliably unique identifiers.
* UUIDs are generated using the {@link https://github.com/uuidjs/uuid} library.
*/
UUIDv4Generator = 4,
/**
* Implementation that just uses version 3 UUIDs as reliably unique identifiers.
* UUIDs are generated using the {@link https://github.com/uuidjs/uuid} library.
*/
UUIDv3Generator = 5,
/**
* Implementation that just uses version 1 UUIDs as reliably unique identifiers.
* UUIDs are generated using the {@link https://github.com/uuidjs/uuid} library.
*/
UUIDv1Generator = 6
}
Expand All @@ -48,6 +46,9 @@ export declare enum ObjectIdGenerator {
* In practice this is done by serializing the first instance as full object and object identity,
* and other references to the object as reference values.
*
* **IMPORTANT NOTE**: To be able to use {@link JsonIdentityInfo} with any UUID {@link ObjectIdGenerator}, an UUID library needs to be set.
* UUID libraries supported: {@link https://github.com/uuidjs/uuid}.
*
* @example
* ```typescript
* @JsonIdentityInfo({generator: ObjectIdGenerator.PropertyGenerator, property: 'id', scope: 'User'})
Expand Down
26 changes: 13 additions & 13 deletions dist/lib.js

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions dist/lib.node.js

Large diffs are not rendered by default.

Loading

0 comments on commit b9a1be7

Please sign in to comment.