import * as plugins from './plugins.js'; import { SmartdataCollection } from './classes.collection.js'; import { SmartdataDb } from './classes.db.js'; export class CollectionFactory { public collections: { [key: string]: SmartdataCollection } = {}; public getCollection = (nameArg: string, dbArg: SmartdataDb): SmartdataCollection => { if (!this.collections[nameArg] && dbArg instanceof SmartdataDb) { this.collections[nameArg] = new SmartdataCollection(nameArg, dbArg); } return this.collections[nameArg]; }; }