import { ReferenceKind, Utils } from '@mikro-orm/core';
import { prepareMetadataContext, processDecoratorParameters } from '../utils.js';
export function OneToMany(entity, mappedBy, options = {}) {
  return function (value, context) {
    const meta = prepareMetadataContext(context, ReferenceKind.ONE_TO_MANY);
    options = processDecoratorParameters({ entity, mappedBy, options });
    const property = { name: context.name, kind: ReferenceKind.ONE_TO_MANY };
    meta.properties[context.name] ??= {};
    Utils.mergeConfig(meta.properties[context.name], property, options);
  };
}
