Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

idb-keyval

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idb-keyval - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

2

dist/cjs-compat/index.d.ts
export declare function promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T>;
export declare function createStore(dbName: string, storeName: string): UseStore;
export declare type UseStore = <T>(txMode: IDBTransactionMode, callback: (store: IDBObjectStore) => T) => T extends PromiseLike<any> ? T : Promise<T>;
export declare type UseStore = <T>(txMode: IDBTransactionMode, callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;
/**

@@ -5,0 +5,0 @@ * Get a value by its key.

@@ -30,7 +30,5 @@ 'use strict';

return function (txMode, callback) {
return (// TODO: I'm not sure why I have to cast to any here. Maybe some TypeScript expert can help?
dbp.then(function (db) {
return callback(db.transaction(storeName, txMode).objectStore(storeName));
})
);
return dbp.then(function (db) {
return callback(db.transaction(storeName, txMode).objectStore(storeName));
});
};

@@ -37,0 +35,0 @@ }

export declare function promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T>;
export declare function createStore(dbName: string, storeName: string): UseStore;
export declare type UseStore = <T>(txMode: IDBTransactionMode, callback: (store: IDBObjectStore) => T) => T extends PromiseLike<any> ? T : Promise<T>;
export declare type UseStore = <T>(txMode: IDBTransactionMode, callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;
/**

@@ -5,0 +5,0 @@ * Get a value by its key.

@@ -17,5 +17,3 @@ 'use strict';

const dbp = promisifyRequest(request);
return (txMode, callback) =>
// TODO: I'm not sure why I have to cast to any here. Maybe some TypeScript expert can help?
dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
}

@@ -22,0 +20,0 @@ let defaultGetStoreFunc;

export declare function promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T>;
export declare function createStore(dbName: string, storeName: string): UseStore;
export declare type UseStore = <T>(txMode: IDBTransactionMode, callback: (store: IDBObjectStore) => T) => T extends PromiseLike<any> ? T : Promise<T>;
export declare type UseStore = <T>(txMode: IDBTransactionMode, callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;
/**

@@ -5,0 +5,0 @@ * Get a value by its key.

@@ -24,7 +24,5 @@ function promisifyRequest(request) {

return function (txMode, callback) {
return (// TODO: I'm not sure why I have to cast to any here. Maybe some TypeScript expert can help?
dbp.then(function (db) {
return callback(db.transaction(storeName, txMode).objectStore(storeName));
})
);
return dbp.then(function (db) {
return callback(db.transaction(storeName, txMode).objectStore(storeName));
});
};

@@ -31,0 +29,0 @@ }

export declare function promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T>;
export declare function createStore(dbName: string, storeName: string): UseStore;
export declare type UseStore = <T>(txMode: IDBTransactionMode, callback: (store: IDBObjectStore) => T) => T extends PromiseLike<any> ? T : Promise<T>;
export declare type UseStore = <T>(txMode: IDBTransactionMode, callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;
/**

@@ -5,0 +5,0 @@ * Get a value by its key.

@@ -13,5 +13,3 @@ function promisifyRequest(request) {

const dbp = promisifyRequest(request);
return (txMode, callback) =>
// TODO: I'm not sure why I have to cast to any here. Maybe some TypeScript expert can help?
dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
}

@@ -18,0 +16,0 @@ let defaultGetStoreFunc;

{
"name": "idb-keyval",
"version": "5.0.0",
"version": "5.0.1",
"description": "A super-simple-small keyval store built on top of IndexedDB",

@@ -5,0 +5,0 @@ "main": "./dist/cjs-compat/index.js",

@@ -18,6 +18,5 @@ export function promisifyRequest<T = undefined>(

return (txMode, callback) =>
// TODO: I'm not sure why I have to cast to any here. Maybe some TypeScript expert can help?
dbp.then((db) =>
callback(db.transaction(storeName, txMode).objectStore(storeName)),
) as any;
);
}

@@ -27,4 +26,4 @@

txMode: IDBTransactionMode,
callback: (store: IDBObjectStore) => T,
) => T extends PromiseLike<any> ? T : Promise<T>;
callback: (store: IDBObjectStore) => T | PromiseLike<T>,
) => Promise<T>;

@@ -31,0 +30,0 @@ let defaultGetStoreFunc: UseStore | undefined;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc