@lillallol/dic
Version:
My own dependency injection container.
17 lines (16 loc) • 620 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRegistrationStrictOf = void 0;
const errorMessages_1 = require("../errorMessages");
/**
* @description
* Returns the registration of the provided abstraction but throws if it does not exist.
*/
function getRegistrationStrictOf(registry, abstraction) {
const registration = registry.get(abstraction);
if (registration === undefined) {
throw Error(errorMessages_1.errorMessages.abstractionNotRegisteredToDic(abstraction));
}
return registration;
}
exports.getRegistrationStrictOf = getRegistrationStrictOf;