(
context:
| ClassFieldDecoratorContext<T>
| ClassGetterDecoratorContext<T>
| ClassSetterDecoratorContext<T>
| ClassAccessorDecoratorContext<T>
| ClassMethodDecoratorContext<T>,
kind?: ReferenceKind,
)
| 105 | * exist for some base entity. |
| 106 | */ |
| 107 | export function prepareMetadataContext<T>( |
| 108 | context: |
| 109 | | ClassFieldDecoratorContext<T> |
| 110 | | ClassGetterDecoratorContext<T> |
| 111 | | ClassSetterDecoratorContext<T> |
| 112 | | ClassAccessorDecoratorContext<T> |
| 113 | | ClassMethodDecoratorContext<T>, |
| 114 | kind?: ReferenceKind, |
| 115 | ): EntityMetadata<T> { |
| 116 | const meta = context.metadata as unknown as EntityMetadata<T>; |
| 117 | |
| 118 | if (!Object.hasOwn(meta, 'properties')) { |
| 119 | meta.properties = { ...meta.properties }; |
| 120 | } |
| 121 | |
| 122 | if (kind) { |
| 123 | validateSingleDecorator(meta, context.name as string, kind); |
| 124 | } |
| 125 | |
| 126 | return meta; |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * Uses some dark magic to get source path to caller where decorator is used. |
no test coverage detected