rage-framework
Version:
## How to Install *server-side* ```bash npm install @rage-framework/server ```
23 lines • 764 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getIdentifier = void 0;
const Token_1 = require("../container/Token");
const CannotInjectError_1 = require("../container/error/CannotInjectError");
const getIdentifier = (typeOrName, target, propertyName) => {
let identifier;
if (typeof typeOrName === 'string') {
identifier = typeOrName;
}
else if (typeOrName instanceof Token_1.Token) {
identifier = typeOrName;
}
else {
identifier = typeOrName();
}
if (identifier === Object) {
throw new CannotInjectError_1.CannotInjectError(target, propertyName);
}
return identifier;
};
exports.getIdentifier = getIdentifier;
//# sourceMappingURL=get-identifier.js.map