Skip to content

Commit 3853235

Browse files
authored
Merge branch 'develop' into fix-143
2 parents 7ca1e48 + b829396 commit 3853235

11 files changed

+2807
-1427
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ language: node_js
22
node_js:
33
- stable
44
- 8
5-
- 6
65

76
after_success:
87
- bash <(curl -s https://codecov.io/bash)

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog and release notes
22

3+
### 0.1.10
4+
5+
#### Fixed
6+
7+
- improve MetadataStorage perf by changing from Arrays to ES6 Maps by @sheiidan
8+
- fixed getAncestor issue with unknown nested properties by @247GradLabs
9+
310
### 0.1.9
411

512
#### Fixed

README.md

Lines changed: 24 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
@@ -611,6 +634,7 @@ The `@Transform` decorator is given more arguments to let you configure how you
611634
|--------------------|------------------------------------------|---------------------------------------------|
612635
| `@TransformClassToPlain` | `@TransformClassToPlain({ groups: ["user"] })` | Transform the method return with classToPlain and expose the properties on the class.
613636
| `@TransformClassToClass` | `@TransformClassToClass({ groups: ["user"] })` | Transform the method return with classToClass and expose the properties on the class.
637+
| `@TransformPlainToClass` | `@TransformPlainToClass(User, { groups: ["user"] })` | Transform the method return with plainToClass and expose the properties on the class.
614638

615639
The above decorators accept one optional argument:
616640
ClassTransformOptions - The transform options like groups, version, name

0 commit comments

Comments
 (0)