UNPKG

awilix

Version:

Extremely powerful dependency injection container.

32 lines 908 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Lifetime = void 0; exports.isLifetimeLonger = isLifetimeLonger; /** * Lifetime types. */ exports.Lifetime = { /** * The registration will be resolved once and only once. * @type {String} */ SINGLETON: 'SINGLETON', /** * The registration will be resolved every time (never cached). * @type {String} */ TRANSIENT: 'TRANSIENT', /** * The registration will be resolved once per scope. * @type {String} */ SCOPED: 'SCOPED', }; /** * Returns true if and only if the first lifetime is strictly longer than the second. */ function isLifetimeLonger(a, b) { return ((a === exports.Lifetime.SINGLETON && b !== exports.Lifetime.SINGLETON) || (a === exports.Lifetime.SCOPED && b === exports.Lifetime.TRANSIENT)); } //# sourceMappingURL=lifetime.js.map