@malagu/core
Version:
27 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AnnotationUtil = void 0;
var AnnotationUtil;
(function (AnnotationUtil) {
function getValueOrOption(valueOrOption, primaryProperty = 'id') {
let option = {};
if (typeof valueOrOption === 'object' && !Array.isArray(valueOrOption)) {
option = valueOrOption;
}
else if (valueOrOption) {
option = { [primaryProperty]: valueOrOption };
}
return option;
}
AnnotationUtil.getValueOrOption = getValueOrOption;
function getType(target, targetKey, index) {
if (index !== undefined) {
return Reflect.getMetadata('design:paramtypes', target, targetKey)[index];
}
else {
return Reflect.getMetadata('design:type', target, targetKey);
}
}
AnnotationUtil.getType = getType;
})(AnnotationUtil = exports.AnnotationUtil || (exports.AnnotationUtil = {}));
//# sourceMappingURL=annotation-util.js.map