Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}) as any
// Extend storex instance with Memex-specific methods
const instance = new Storex({ backend }) as StorageManager
const oldMethod = instance.collection.bind(instance)
instance.collection = (name: string) => ({
...oldMethod(name),
suggestObjects: (query, opts) =>
suggestObjects(new Promise(res => res(backend.dexieInstance as Dexie)))(
name,
query,
opts,
),
})
instance.deleteDB = indexedDB.deleteDatabase
export default instance