@dolittle/sdk.common
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
23 lines • 1.79 kB
JavaScript
;
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAppliedDecorators = void 0;
const getDecoratorMetadata_1 = require("./getDecoratorMetadata");
const setDecoratorMetadata_1 = require("./setDecoratorMetadata");
const APPLIED_DECORATORS_NAME = 'decorators';
/**
* Gets the list of decorators that have been applied to the specified type.
* @param {Constructor<any>} type - The type to get the applied decorators for.
* @returns {AppliedDecorator[]} The applied decorators.
*/
function getAppliedDecorators(type) {
let decorators = (0, getDecoratorMetadata_1.getDecoratorMetadata)(APPLIED_DECORATORS_NAME, type, true);
if (decorators === undefined) {
decorators = [];
(0, setDecoratorMetadata_1.setDecoratorMetadata)(APPLIED_DECORATORS_NAME, type, decorators);
}
return decorators;
}
exports.getAppliedDecorators = getAppliedDecorators;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0QXBwbGllZERlY29yYXRvcnMuanMiLCJzb3VyY2VSb290IjoiLi4vIiwic291cmNlcyI6WyJEZWNvcmF0b3JzL2dldEFwcGxpZWREZWNvcmF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSwrQ0FBK0M7QUFDL0MscUdBQXFHOzs7QUFJckcsaUVBQThEO0FBQzlELGlFQUE4RDtBQUU5RCxNQUFNLHVCQUF1QixHQUFHLFlBQVksQ0FBQztBQWE3Qzs7OztHQUlHO0FBQ0gsU0FBZ0Isb0JBQW9CLENBQUMsSUFBc0I7SUFDdkQsSUFBSSxVQUFVLEdBQUcsSUFBQSwyQ0FBb0IsRUFBcUIsdUJBQXVCLEVBQUUsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO0lBRS9GLElBQUksVUFBVSxLQUFLLFNBQVMsRUFBRTtRQUMxQixVQUFVLEdBQUcsRUFBRSxDQUFDO1FBQ2hCLElBQUEsMkNBQW9CLEVBQUMsdUJBQXVCLEVBQUUsSUFBSSxFQUFFLFVBQVUsQ0FBQyxDQUFDO0tBQ25FO0lBRUQsT0FBTyxVQUFVLENBQUM7QUFDdEIsQ0FBQztBQVRELG9EQVNDIn0=