Skip to content

Commit 01e7939

Browse files
authored
Add doc section for ES6 collections Set and Map
1 parent 7343716 commit 01e7939

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,29 @@ export class Photo {
566566

567567
Library will handle proper transformation automatically.
568568

569+
ES6 collections `Set` and `Map` also require the `@Type` decorator:
570+
571+
```typescript
572+
export class Skill {
573+
name: string;
574+
}
575+
576+
export class Weapon {
577+
name: string;
578+
range: number;
579+
}
580+
581+
export class Player {
582+
name: string;
583+
584+
@Type(() => Skill)
585+
skills: Set<Skill>;
586+
587+
@Type(() => Weapon)
588+
weapons: Map<string, Weapon>;
589+
}
590+
```
591+
569592
## Additional data transformation
570593

571594
You can perform additional data transformation using `@Transform` decorator.

0 commit comments

Comments
 (0)