UNPKG

@ayanaware/bento

Version:

Modular runtime framework designed to solve complex tasks

24 lines 906 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ChildOf = exports.getChildOf = void 0; const CHILDOF_KEY = '@ayanaware/bento:ChildOf'; // eslint-disable-next-line @typescript-eslint/ban-types function getChildOf(target) { const childOf = Reflect.getMetadata(CHILDOF_KEY, target); if (!childOf) return null; return childOf; } exports.getChildOf = getChildOf; function ChildOf(reference) { return (target) => { if (!reference) throw new Error('ChildOf(): EntityReference not provided'); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access if (target.prototype === undefined) target = target.constructor; Reflect.defineMetadata(CHILDOF_KEY, reference, target); }; } exports.ChildOf = ChildOf; //# sourceMappingURL=ChildOf.js.map