import { Utils } from '@mikro-orm/core';
import { getMetadataFromDecorator } from '../utils.js';
/** Marks a class as an embeddable type (TC39 decorator). */
export function Embeddable(options = {}) {
  return function (target, context) {
    const meta = getMetadataFromDecorator(target);
    const metadata = { ...context.metadata };
    Utils.mergeConfig(meta, metadata, options);
    meta.class = target;
    meta.name = meta.class.name;
    meta.embeddable = true;
    return target;
  };
}
