"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cachedInstance = void 0;
exports.setFactory = setFactory;
exports.getInstance = getInstance;
exports.tryInstance = tryInstance;
let registeredFactory = () => {
    throw new Error(`Assertion failed: No libzip instance is available, and no factory was configured`);
};
function setFactory(factory) {
    registeredFactory = factory;
}
function getInstance() {
    if (typeof exports.cachedInstance === `undefined`)
        exports.cachedInstance = registeredFactory();
    return exports.cachedInstance;
}
function tryInstance() {
    return exports.cachedInstance;
}
