* define metadata for a target class or it's property/method
(
metadataKey: string,
metadataValue: any,
target: Object,
propertyKey?: string,
)
| 25 | * define metadata for a target class or it's property/method |
| 26 | */ |
| 27 | defineMetadata( |
| 28 | metadataKey: string, |
| 29 | metadataValue: any, |
| 30 | target: Object, |
| 31 | propertyKey?: string, |
| 32 | ) { |
| 33 | metadataKey = this.getMetadataKey(metadataKey); |
| 34 | if (propertyKey) { |
| 35 | Reflect.defineMetadata(metadataKey, metadataValue, target, propertyKey); |
| 36 | } else { |
| 37 | Reflect.defineMetadata(metadataKey, metadataValue, target); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * lookup metadata from a target object and its prototype chain |