(
options: CreateDecoratorOptions<TParam, TTransformed> = {},
)
| 55 | options: CreateDecoratorWithTransformOptions<TParam, TTransformed>, |
| 56 | ): ReflectableDecorator<TParam, TTransformed>; |
| 57 | static createDecorator<TParam, TTransformed = TParam>( |
| 58 | options: CreateDecoratorOptions<TParam, TTransformed> = {}, |
| 59 | ): ReflectableDecorator<TParam, TTransformed> { |
| 60 | const metadataKey = options.key ?? uid(21); |
| 61 | const decoratorFn = |
| 62 | (metadataValue: TParam) => |
| 63 | (target: object | Function, key?: string | symbol, descriptor?: any) => { |
| 64 | const value = options.transform |
| 65 | ? options.transform(metadataValue) |
| 66 | : metadataValue; |
| 67 | SetMetadata(metadataKey, value ?? {})(target, key!, descriptor); |
| 68 | }; |
| 69 | |
| 70 | decoratorFn.KEY = metadataKey; |
| 71 | return decoratorFn as ReflectableDecorator<TParam, TTransformed>; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Retrieve metadata for a reflectable decorator for a specified target. |
no outgoing calls
no test coverage detected