|
1 | 1 | # class-transformer
|
2 | 2 |
|
3 |
| -[](https://travis-ci.org/pleerock/class-transformer) |
4 |
| -[](https://codecov.io/gh/pleerock/class-transformer) |
| 3 | +[](https://travis-ci.org/typestack/class-transformer) |
| 4 | +[](https://codecov.io/gh/typestack/class-transformer) |
5 | 5 | [](https://badge.fury.io/js/class-transformer)
|
6 |
| -[](https://david-dm.org/pleerock/class-transformer) |
7 |
| -[](https://gitter.im/pleerock/class-transformer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 6 | +[](https://david-dm.org/typestack/class-transformer) |
| 7 | +[](https://gitter.im/typestack/class-transformer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
8 | 8 |
|
9 | 9 | Its ES6 and Typescript era. Nowadays you are working with classes and constructor objects more then ever.
|
10 | 10 | Class-transformer allows you to transform plain object to some instance of class and versa.
|
@@ -224,14 +224,14 @@ You can deserialize your model to from a json using `deserialize` method:
|
224 | 224 |
|
225 | 225 | ```typescript
|
226 | 226 | import {deserialize} from "class-transformer";
|
227 |
| -let photo = deserialize(photo); |
| 227 | +let photo = deserialize(Photo, photo); |
228 | 228 | ```
|
229 | 229 |
|
230 | 230 | To make deserialization to work with arrays use `deserializeArray` method:
|
231 | 231 |
|
232 | 232 | ```typescript
|
233 | 233 | import {deserializeArray} from "class-transformer";
|
234 |
| -let photos = deserializeArray(photos); |
| 234 | +let photos = deserializeArray(Photo, photos); |
235 | 235 | ```
|
236 | 236 |
|
237 | 237 | ## Working with nested objects
|
@@ -658,7 +658,7 @@ the exposed variables. email property is also exposed becuase we metioned the gr
|
658 | 658 | ## Working with generics
|
659 | 659 |
|
660 | 660 | Generics are not supported because TypeScript does not have good reflection abilities yet.
|
661 |
| -Once TypeScript team provide us better runtime type reelection tools, generics will be implemented. |
| 661 | +Once TypeScript team provide us better runtime type reflection tools, generics will be implemented. |
662 | 662 | There are some tweaks however you can use, that maybe can solve your problem.
|
663 | 663 | [Checkout this example.](https://github.com/pleerock/class-transformer/tree/master/sample/sample4-generics)
|
664 | 664 |
|
|
0 commit comments