Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new minimongo.MemoryDb({namespace: this.namespace}, localDb => {
const hybridDb = new minimongo.HybridDb(localDb, this.remoteDb);
let type;
if (localDb instanceof minimongo.IndexedDb) {
type = 'IndexedDb';
} else if (localDb instanceof minimongo.LocalStorageDb) {
type = 'LocalStorageDb';
} else if (localDb instanceof minimongo.MemoryDb) {
type = 'MemoryDb';
} else if (localDb instanceof minimongo.WebSQLDb) {
type = 'WebSQLDb';
} else {
throw new Error('Can\'t identify db');
}
this.hybridDb = hybridDb;
resolve(hybridDb, type)
}, reject);
});