UNPKG

@ayanaware/bento

Version:

Modular runtime framework designed to solve complex tasks

24 lines 993 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Variable = exports.getVariables = void 0; const VARIABLE_KEY = '@ayanaware/bento:Variable'; // eslint-disable-next-line @typescript-eslint/ban-types function getVariables(target) { const variables = Reflect.getMetadata(VARIABLE_KEY, target); if (!Array.isArray(variables)) return []; return variables; } exports.getVariables = getVariables; function Variable(definition) { return (target, propertyKey) => { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access if (target.prototype === undefined) target = target.constructor; const variables = Reflect.getMetadata(VARIABLE_KEY, target) || []; variables.push({ key: propertyKey, definition }); Reflect.defineMetadata(VARIABLE_KEY, variables, target); }; } exports.Variable = Variable; //# sourceMappingURL=Variable.js.map