Are there any packages available for mapping two object in typescript I.E Automapper? I found a couple of packages but they don't have enough document for implementation.
Asked
Active
Viewed 2.3k times
12
-
Possible duplicate of [How to map objects (DTO) on client side?](https://stackoverflow.com/questions/48802922/how-to-map-objects-dto-on-client-side) – aaron May 14 '18 at 15:39
-
No, It is different. – Bhautik Dalicha May 15 '18 at 08:17
3 Answers
8
Here are a couple I am aware of:
- https://github.com/loedeman/AutoMapper (https://www.npmjs.com/package/automapper-ts)
- https://github.com/typestack/class-transformer
There is also a good discussion about this at https://www.reddit.com/r/javascript/comments/4tg69t/question_typescript_auto_mapping/ that might be of interest.

Matthew Heironimus
- 356
- 3
- 9
2
Unfortunately, it seems https://github.com/loedeman/AutoMapper is not well-maintained. As of answering your question, it has not been updated since 2017.
While digging through the "Issues" section I found a well-maintained fork: https://github.com/nartc/mapper

ahong
- 1,041
- 2
- 10
- 22
1
have you looked at
- mpr the object mapper - for Typescript and JavaScript
- Docs are here
Disclaimer I'm the author, I wrote it as I wanted some more of the advanced options (note it flexible with how classes are detailed and mapped)

dbones
- 4,415
- 3
- 36
- 52