(
entity: OneToManyOptions<Owner, Target> | string | ((e?: any) => EntityName<Target>),
mappedBy?: (string & keyof Target) | ((e: Target) => any),
options: Partial<OneToManyOptions<Owner, Target>> = {},
)
| 19 | options: OneToManyOptions<Owner, Target>, |
| 20 | ): (value: unknown, context: ClassFieldDecoratorContext<Owner, Collection<Target> | undefined>) => void; |
| 21 | export function OneToMany<Target extends object, Owner extends object>( |
| 22 | entity: OneToManyOptions<Owner, Target> | string | ((e?: any) => EntityName<Target>), |
| 23 | mappedBy?: (string & keyof Target) | ((e: Target) => any), |
| 24 | options: Partial<OneToManyOptions<Owner, Target>> = {}, |
| 25 | ): (value: unknown, context: ClassFieldDecoratorContext<Owner, Collection<Target> | undefined>) => void { |
| 26 | return function (value: unknown, context: ClassFieldDecoratorContext<Owner, Collection<Target> | undefined>) { |
| 27 | const meta = prepareMetadataContext(context, ReferenceKind.ONE_TO_MANY); |
| 28 | options = processDecoratorParameters<OneToManyOptions<Owner, Target>>({ entity, mappedBy, options }); |
| 29 | const property = { name: context.name, kind: ReferenceKind.ONE_TO_MANY } as EntityProperty<Owner>; |
| 30 | meta.properties[context.name as EntityKey<Owner>] ??= {} as any; |
| 31 | Utils.mergeConfig(meta.properties[context.name as EntityKey<Owner>], property, options); |
| 32 | }; |
| 33 | } |
no test coverage detected