@inversifyjs/container
Version: 
InversifyJs container
16 lines • 768 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getContainerModuleId = getContainerModuleId;
const reflect_metadata_utils_1 = require("@inversifyjs/reflect-metadata-utils");
const ID_METADATA = '@inversifyjs/container/bindingId';
function getContainerModuleId() {
    const bindingId = (0, reflect_metadata_utils_1.getOwnReflectMetadata)(Object, ID_METADATA) ?? 0;
    if (bindingId === Number.MAX_SAFE_INTEGER) {
        (0, reflect_metadata_utils_1.setReflectMetadata)(Object, ID_METADATA, Number.MIN_SAFE_INTEGER);
    }
    else {
        (0, reflect_metadata_utils_1.updateOwnReflectMetadata)(Object, ID_METADATA, () => bindingId, (id) => id + 1);
    }
    return bindingId;
}
//# sourceMappingURL=getContainerModuleId.js.map