#Is there any way to get the metadata of the properties of a class who use a decorator?
6 messages · Page 1 of 1 (latest)
Was wondering about this too, it would be great for testing validation rules
Look into how the Column() decorator is implemented. It probably sets some metadata key on the class. You can read the keys that with Reflect.getMetadataKeys(User) (https://www.npmjs.com/package/reflect-metadata)
(nest's Reflector is just an abstraction over reflect-metadata , so you can use it too)
Reflect.getMetadataKeys(User) - returns an empty array
I looked at the typeorm implementation but I don;t really understand it, it's a bit advanced for me