"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Factory = void 0;
class FactoryHouse {
    constructor() {
        this.factories = {};
        console.log('::::::factory initiated:::::');
    }
    static getInstance() {
        if (this.instance) {
            return this.instance;
        }
        return new FactoryHouse();
    }
    get(identifier) {
        return this.factories[identifier];
    }
    set(identifier, fn) {
        if (fn === null) {
            throw { message: 'function to provide must not be null' };
        }
        this.factories[identifier] = fn;
    }
    remove(identifier) {
        if (this.factories.hasOwnProperty(identifier)) {
            delete this.factories[identifier];
            return true;
        }
        return false;
    }
}
exports.Factory = FactoryHouse.getInstance();
