Skip to content

Commit 6f2b341

Browse files
authored
Merge pull request #69 from thevtm/master
Add doc section for ES6 collections Set and Map
2 parents 4a99a5b + 01e7939 commit 6f2b341

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
@@ -565,6 +565,29 @@ export class Photo {
565565

566566
Library will handle proper transformation automatically.
567567

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

570593
### Basic usage

0 commit comments

Comments
 (0)