idb-keyval
Advanced tools
Comparing version 2.5.0 to 2.5.1
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";function e(){return t||(t=new Promise(function(e,n){var t=indexedDB.open("keyval-store",1);t.onerror=function(){n(t.error)},t.onupgradeneeded=function(){t.result.createObjectStore("keyval")},t.onsuccess=function(){e(t.result)}})),t}function n(n,t){return e().then(function(e){return new Promise(function(r,o){var u=e.transaction("keyval",n);u.oncomplete=function(){r()},u.onerror=function(){o(u.error)},t(u.objectStore("keyval"))})})}var t,r={get:function(e){var t;return n("readonly",function(n){t=n.get(e)}).then(function(){return t.result})},set:function(e,t){return n("readwrite",function(n){n.put(t,e)})},"delete":function(e){return n("readwrite",function(n){n["delete"](e)})},clear:function(){return n("readwrite",function(e){e.clear()})},keys:function(){var e=[];return n("readonly",function(n){(n.openKeyCursor||n.openCursor).call(n).onsuccess=function(){this.result&&(e.push(this.result.key),this.result["continue"]())}}).then(function(){return e})}};"undefined"!=typeof module&&module.exports?module.exports=r:"function"==typeof define&&define.amd?define("idbKeyval",[],function(){return r}):self.idbKeyval=r}(); | ||
!function(){"use strict";function e(){return t||(t=new Promise(function(e,n){var t=indexedDB.open("keyval-store",1);t.onerror=function(){n(t.error)},t.onupgradeneeded=function(){t.result.createObjectStore("keyval")},t.onsuccess=function(){e(t.result)}})),t}function n(n,t){return e().then(function(e){return new Promise(function(r,o){var u=e.transaction("keyval",n);u.oncomplete=function(){r()},u.onabort=u.onerror=function(){o(u.error)},t(u.objectStore("keyval"))})})}var t,r={get:function(e){var t;return n("readonly",function(n){t=n.get(e)}).then(function(){return t.result})},set:function(e,t){return n("readwrite",function(n){n.put(t,e)})},delete:function(e){return n("readwrite",function(n){n.delete(e)})},clear:function(){return n("readwrite",function(e){e.clear()})},keys:function(){var e=[];return n("readonly",function(n){(n.openKeyCursor||n.openCursor).call(n).onsuccess=function(){this.result&&(e.push(this.result.key),this.result.continue())}}).then(function(){return e})}};"undefined"!=typeof module&&module.exports?module.exports=r:"function"==typeof define&&define.amd?define("idbKeyval",[],function(){return r}):self.idbKeyval=r}(); |
@@ -34,3 +34,3 @@ (function() { | ||
}; | ||
transaction.onerror = function() { | ||
transaction.onabort = transaction.onerror = function() { | ||
reject(transaction.error); | ||
@@ -37,0 +37,0 @@ }; |
{ | ||
"name": "idb-keyval", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "A super-simple-small keyval store built on top of IndexedDB", | ||
@@ -5,0 +5,0 @@ "main": "idb-keyval.js", |
@@ -60,21 +60,1 @@ # IDB-Keyval | ||
That's it! | ||
## Installing | ||
### Via npm | ||
```sh | ||
npm install idb-keyval | ||
``` | ||
Now you can require/import `idb-keyval`: | ||
```js | ||
const idbKeyval = require('idb-keyval'); | ||
``` | ||
### Via `<script>` | ||
`idb-keyval.js` is a valid JS module. | ||
`dist/idb-keyval.iffe.js` can be used in browsers that don't support modules. `idbKeyval` is created as a global. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7193
100
60