mirror of
https://gitee.com/bimuziyan/ccc-obfuscated-code.git
synced 2026-07-02 08:25:41 +08:00
14 lines
543 B
JavaScript
14 lines
543 B
JavaScript
import * as ERRORS_MSGS from "../constants/error_msgs";
|
|
import * as METADATA_KEY from "../constants/metadata_keys";
|
|
function injectable() {
|
|
return function (target) {
|
|
if (Reflect.hasOwnMetadata(METADATA_KEY.PARAM_TYPES, target)) {
|
|
throw new Error(ERRORS_MSGS.DUPLICATED_INJECTABLE_DECORATOR);
|
|
}
|
|
var types = Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, target) || [];
|
|
Reflect.defineMetadata(METADATA_KEY.PARAM_TYPES, types, target);
|
|
return target;
|
|
};
|
|
}
|
|
export { injectable };
|