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
module.exports = function createContext(globalScope, contextlocation, contextpath, origin, fetch) {
const scriptModule = { exports: {} };
const context = Object.assign(globalScope, {
Cache,
CacheStorage,
Client,
Clients,
ExtendableEvent,
FetchEvent,
FormData,
Headers,
IDBCursor: FDBCursor.default,
IDBCursorWithValue: FDBCursorWithValue.default,
IDBDatabase: FDBDatabase.default,
IDBFactory: FDBFactory.default,
IDBIndex: FDBIndex.default,
IDBKeyRange: FDBKeyRange.default,
IDBObjectStore: FDBObjectStore.default,
IDBOpenDBRequest: FDBOpenDBRequest.default,
IDBRequest: FDBRequest.default,
IDBTransaction: FDBTransaction.default,
IDBVersionChangeEvent: FDBVersionChangeEvent.default,
MessageChannel,
MessageEvent,
MessagePort,
navigator: {
connection: 'not implemented',
online: true,
module.exports = function createContext(globalScope, contextlocation, contextpath, origin, fetch) {
const scriptModule = { exports: {} };
const context = Object.assign(globalScope, {
Cache,
CacheStorage,
Client,
Clients,
ExtendableEvent,
FetchEvent,
FormData,
Headers,
IDBCursor: FDBCursor.default,
IDBCursorWithValue: FDBCursorWithValue.default,
IDBDatabase: FDBDatabase.default,
IDBFactory: FDBFactory.default,
IDBIndex: FDBIndex.default,
IDBKeyRange: FDBKeyRange.default,
IDBObjectStore: FDBObjectStore.default,
IDBOpenDBRequest: FDBOpenDBRequest.default,
IDBRequest: FDBRequest.default,
IDBTransaction: FDBTransaction.default,
IDBVersionChangeEvent: FDBVersionChangeEvent.default,
MessageChannel,
MessageEvent,
MessagePort,
navigator: {
connection: 'not implemented',
online: true,
permissions: 'not implemented',
module.exports = function createContext(globalScope, contextlocation, contextpath, origin, fetch) {
const scriptModule = { exports: {} };
const context = Object.assign(globalScope, {
Cache,
CacheStorage,
Client,
Clients,
ExtendableEvent,
FetchEvent,
FormData,
Headers,
IDBCursor: FDBCursor.default,
IDBCursorWithValue: FDBCursorWithValue.default,
IDBDatabase: FDBDatabase.default,
IDBFactory: FDBFactory.default,
IDBIndex: FDBIndex.default,
IDBKeyRange: FDBKeyRange.default,
IDBObjectStore: FDBObjectStore.default,
IDBOpenDBRequest: FDBOpenDBRequest.default,
IDBRequest: FDBRequest.default,
IDBTransaction: FDBTransaction.default,
IDBVersionChangeEvent: FDBVersionChangeEvent.default,
MessageChannel,
MessageEvent,
MessagePort,
navigator: {
connection: 'not implemented',
online: true,
permissions: 'not implemented',
storage: 'not implemented',
module.exports = function createContext(globalScope, contextlocation, contextpath, origin, fetch) {
const scriptModule = { exports: {} };
const context = Object.assign(globalScope, {
Cache,
CacheStorage,
Client,
Clients,
ExtendableEvent,
FetchEvent,
FormData,
Headers,
IDBCursor: FDBCursor.default,
IDBCursorWithValue: FDBCursorWithValue.default,
IDBDatabase: FDBDatabase.default,
IDBFactory: FDBFactory.default,
IDBIndex: FDBIndex.default,
IDBKeyRange: FDBKeyRange.default,
IDBObjectStore: FDBObjectStore.default,
IDBOpenDBRequest: FDBOpenDBRequest.default,
IDBRequest: FDBRequest.default,
IDBTransaction: FDBTransaction.default,
IDBVersionChangeEvent: FDBVersionChangeEvent.default,
MessageChannel,
MessageEvent,
MessagePort,
navigator: {
connection: 'not implemented',
online: true,
permissions: 'not implemented',
storage: 'not implemented',
userAgent: 'sw-test-env'
module.exports = function createContext(globalScope, contextlocation, contextpath, origin, fetch) {
const scriptModule = { exports: {} };
const context = Object.assign(globalScope, {
Cache,
CacheStorage,
Client,
Clients,
ExtendableEvent,
FetchEvent,
FormData,
Headers,
IDBCursor: FDBCursor.default,
IDBCursorWithValue: FDBCursorWithValue.default,
IDBDatabase: FDBDatabase.default,
IDBFactory: FDBFactory.default,
IDBIndex: FDBIndex.default,
IDBKeyRange: FDBKeyRange.default,
IDBObjectStore: FDBObjectStore.default,
IDBOpenDBRequest: FDBOpenDBRequest.default,
IDBRequest: FDBRequest.default,
IDBTransaction: FDBTransaction.default,
IDBVersionChangeEvent: FDBVersionChangeEvent.default,
MessageChannel,
MessageEvent,
MessagePort,
navigator: {
connection: 'not implemented',
online: true,
permissions: 'not implemented',
storage: 'not implemented',
userAgent: 'sw-test-env'
},
const scriptModule = { exports: {} };
const context = Object.assign(globalScope, {
Cache,
CacheStorage,
Client,
Clients,
ExtendableEvent,
FetchEvent,
FormData,
Headers,
IDBCursor: FDBCursor.default,
IDBCursorWithValue: FDBCursorWithValue.default,
IDBDatabase: FDBDatabase.default,
IDBFactory: FDBFactory.default,
IDBIndex: FDBIndex.default,
IDBKeyRange: FDBKeyRange.default,
IDBObjectStore: FDBObjectStore.default,
IDBOpenDBRequest: FDBOpenDBRequest.default,
IDBRequest: FDBRequest.default,
IDBTransaction: FDBTransaction.default,
IDBVersionChangeEvent: FDBVersionChangeEvent.default,
MessageChannel,
MessageEvent,
MessagePort,
navigator: {
connection: 'not implemented',
online: true,
permissions: 'not implemented',
storage: 'not implemented',
userAgent: 'sw-test-env'
},
Notification,
const context = Object.assign(globalScope, {
Cache,
CacheStorage,
Client,
Clients,
ExtendableEvent,
FetchEvent,
FormData,
Headers,
IDBCursor: FDBCursor.default,
IDBCursorWithValue: FDBCursorWithValue.default,
IDBDatabase: FDBDatabase.default,
IDBFactory: FDBFactory.default,
IDBIndex: FDBIndex.default,
IDBKeyRange: FDBKeyRange.default,
IDBObjectStore: FDBObjectStore.default,
IDBOpenDBRequest: FDBOpenDBRequest.default,
IDBRequest: FDBRequest.default,
IDBTransaction: FDBTransaction.default,
IDBVersionChangeEvent: FDBVersionChangeEvent.default,
MessageChannel,
MessageEvent,
MessagePort,
navigator: {
connection: 'not implemented',
online: true,
permissions: 'not implemented',
storage: 'not implemented',
userAgent: 'sw-test-env'
},
Notification,
NotificationEvent,
Cache,
CacheStorage,
Client,
Clients,
ExtendableEvent,
FetchEvent,
FormData,
Headers,
IDBCursor: FDBCursor.default,
IDBCursorWithValue: FDBCursorWithValue.default,
IDBDatabase: FDBDatabase.default,
IDBFactory: FDBFactory.default,
IDBIndex: FDBIndex.default,
IDBKeyRange: FDBKeyRange.default,
IDBObjectStore: FDBObjectStore.default,
IDBOpenDBRequest: FDBOpenDBRequest.default,
IDBRequest: FDBRequest.default,
IDBTransaction: FDBTransaction.default,
IDBVersionChangeEvent: FDBVersionChangeEvent.default,
MessageChannel,
MessageEvent,
MessagePort,
navigator: {
connection: 'not implemented',
online: true,
permissions: 'not implemented',
storage: 'not implemented',
userAgent: 'sw-test-env'
},
Notification,
NotificationEvent,
PushEvent,
CacheStorage,
Client,
Clients,
ExtendableEvent,
FetchEvent,
FormData,
Headers,
IDBCursor: FDBCursor.default,
IDBCursorWithValue: FDBCursorWithValue.default,
IDBDatabase: FDBDatabase.default,
IDBFactory: FDBFactory.default,
IDBIndex: FDBIndex.default,
IDBKeyRange: FDBKeyRange.default,
IDBObjectStore: FDBObjectStore.default,
IDBOpenDBRequest: FDBOpenDBRequest.default,
IDBRequest: FDBRequest.default,
IDBTransaction: FDBTransaction.default,
IDBVersionChangeEvent: FDBVersionChangeEvent.default,
MessageChannel,
MessageEvent,
MessagePort,
navigator: {
connection: 'not implemented',
online: true,
permissions: 'not implemented',
storage: 'not implemented',
userAgent: 'sw-test-env'
},
Notification,
NotificationEvent,
PushEvent,
PushManager,