@isomorphic-git/idb-keyval
Advanced tools
Comparing version 3.3.1 to 3.3.2
@@ -15,3 +15,3 @@ define(['exports'], function (exports) { 'use strict'; | ||
this._dbp = new Promise((resolve, reject) => { | ||
const openreq = indexedDB.open(this._dbName, 1); | ||
const openreq = indexedDB.open(this._dbName); | ||
openreq.onerror = () => reject(openreq.error); | ||
@@ -18,0 +18,0 @@ openreq.onsuccess = () => resolve(openreq.result); |
@@ -1,1 +0,1 @@ | ||
define(["exports"],function(e){"use strict";class t{constructor(e="keyval-store",t="keyval"){this.storeName=t,this._dbName=e,this._storeName=t,this._init()}_init(){this._dbp||(this._dbp=new Promise((e,t)=>{const r=indexedDB.open(this._dbName,1);r.onerror=(()=>t(r.error)),r.onsuccess=(()=>e(r.result)),r.onupgradeneeded=(()=>{r.result.createObjectStore(this._storeName)})}))}_withIDBStore(e,t){return this._init(),this._dbp.then(r=>new Promise((n,o)=>{const s=r.transaction(this.storeName,e);s.oncomplete=(()=>n()),s.onabort=s.onerror=(()=>o(s.error)),t(s.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(e=>{e.close(),this._dbp=void 0})}}let r;function n(){return r||(r=new t),r}e.Store=t,e.get=function(e,t=n()){let r;return t._withIDBStore("readwrite",t=>{r=t.get(e)}).then(()=>r.result)},e.set=function(e,t,r=n()){return r._withIDBStore("readwrite",r=>{r.put(t,e)})},e.update=function(e,t,r=n()){return r._withIDBStore("readwrite",r=>{const n=r.get(e);n.onsuccess=(()=>{r.put(t(n.result),e)})})},e.del=function(e,t=n()){return t._withIDBStore("readwrite",t=>{t.delete(e)})},e.clear=function(e=n()){return e._withIDBStore("readwrite",e=>{e.clear()})},e.keys=function(e=n()){const t=[];return e._withIDBStore("readwrite",e=>{(e.openKeyCursor||e.openCursor).call(e).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)},e.close=function(e=n()){return e._close()},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
define(["exports"],function(e){"use strict";class t{constructor(e="keyval-store",t="keyval"){this.storeName=t,this._dbName=e,this._storeName=t,this._init()}_init(){this._dbp||(this._dbp=new Promise((e,t)=>{const r=indexedDB.open(this._dbName);r.onerror=(()=>t(r.error)),r.onsuccess=(()=>e(r.result)),r.onupgradeneeded=(()=>{r.result.createObjectStore(this._storeName)})}))}_withIDBStore(e,t){return this._init(),this._dbp.then(r=>new Promise((n,o)=>{const s=r.transaction(this.storeName,e);s.oncomplete=(()=>n()),s.onabort=s.onerror=(()=>o(s.error)),t(s.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(e=>{e.close(),this._dbp=void 0})}}let r;function n(){return r||(r=new t),r}e.Store=t,e.get=function(e,t=n()){let r;return t._withIDBStore("readwrite",t=>{r=t.get(e)}).then(()=>r.result)},e.set=function(e,t,r=n()){return r._withIDBStore("readwrite",r=>{r.put(t,e)})},e.update=function(e,t,r=n()){return r._withIDBStore("readwrite",r=>{const n=r.get(e);n.onsuccess=(()=>{r.put(t(n.result),e)})})},e.del=function(e,t=n()){return t._withIDBStore("readwrite",t=>{t.delete(e)})},e.clear=function(e=n()){return e._withIDBStore("readwrite",e=>{e.clear()})},e.keys=function(e=n()){const t=[];return e._withIDBStore("readwrite",e=>{(e.openKeyCursor||e.openCursor).call(e).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)},e.close=function(e=n()){return e._close()},Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -1,1 +0,1 @@ | ||
"use strict";var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var Store=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keyval-store",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"keyval";_classCallCheck(this,e),this.storeName=r,this._dbName=t,this._storeName=r,this._init()}return _createClass(e,[{key:"_init",value:function(){var e=this;this._dbp||(this._dbp=new Promise(function(t,r){var n=indexedDB.open(e._dbName,1);n.onerror=function(){return r(n.error)},n.onsuccess=function(){return t(n.result)},n.onupgradeneeded=function(){n.result.createObjectStore(e._storeName)}}))}},{key:"_withIDBStore",value:function(e,t){var r=this;return this._init(),this._dbp.then(function(n){return new Promise(function(o,i){var u=n.transaction(r.storeName,e);u.oncomplete=function(){return o()},u.onabort=u.onerror=function(){return i(u.error)},t(u.objectStore(r.storeName))})})}},{key:"_close",value:function(){var e=this;return this._init(),this._dbp.then(function(t){t.close(),e._dbp=void 0})}}]),e}(),store=void 0;function getDefaultStore(){return store||(store=new Store),store}function get(e){var t=void 0;return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:getDefaultStore())._withIDBStore("readwrite",function(r){t=r.get(e)}).then(function(){return t.result})}function set(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:getDefaultStore())._withIDBStore("readwrite",function(r){r.put(t,e)})}function update(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:getDefaultStore())._withIDBStore("readwrite",function(r){var n=r.get(e);n.onsuccess=function(){r.put(t(n.result),e)}})}function del(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:getDefaultStore())._withIDBStore("readwrite",function(t){t.delete(e)})}function clear(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:getDefaultStore())._withIDBStore("readwrite",function(e){e.clear()})}function keys(){var e=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:getDefaultStore())._withIDBStore("readwrite",function(t){(t.openKeyCursor||t.openCursor).call(t).onsuccess=function(){this.result&&(e.push(this.result.key),this.result.continue())}}).then(function(){return e})}function close(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:getDefaultStore())._close()}exports.Store=Store,exports.get=get,exports.set=set,exports.update=update,exports.del=del,exports.clear=clear,exports.keys=keys,exports.close=close; | ||
"use strict";var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var Store=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keyval-store",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"keyval";_classCallCheck(this,e),this.storeName=r,this._dbName=t,this._storeName=r,this._init()}return _createClass(e,[{key:"_init",value:function(){var e=this;this._dbp||(this._dbp=new Promise(function(t,r){var n=indexedDB.open(e._dbName);n.onerror=function(){return r(n.error)},n.onsuccess=function(){return t(n.result)},n.onupgradeneeded=function(){n.result.createObjectStore(e._storeName)}}))}},{key:"_withIDBStore",value:function(e,t){var r=this;return this._init(),this._dbp.then(function(n){return new Promise(function(o,i){var u=n.transaction(r.storeName,e);u.oncomplete=function(){return o()},u.onabort=u.onerror=function(){return i(u.error)},t(u.objectStore(r.storeName))})})}},{key:"_close",value:function(){var e=this;return this._init(),this._dbp.then(function(t){t.close(),e._dbp=void 0})}}]),e}(),store=void 0;function getDefaultStore(){return store||(store=new Store),store}function get(e){var t=void 0;return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:getDefaultStore())._withIDBStore("readwrite",function(r){t=r.get(e)}).then(function(){return t.result})}function set(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:getDefaultStore())._withIDBStore("readwrite",function(r){r.put(t,e)})}function update(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:getDefaultStore())._withIDBStore("readwrite",function(r){var n=r.get(e);n.onsuccess=function(){r.put(t(n.result),e)}})}function del(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:getDefaultStore())._withIDBStore("readwrite",function(t){t.delete(e)})}function clear(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:getDefaultStore())._withIDBStore("readwrite",function(e){e.clear()})}function keys(){var e=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:getDefaultStore())._withIDBStore("readwrite",function(t){(t.openKeyCursor||t.openCursor).call(t).onsuccess=function(){this.result&&(e.push(this.result.key),this.result.continue())}}).then(function(){return e})}function close(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:getDefaultStore())._close()}exports.Store=Store,exports.get=get,exports.set=set,exports.update=update,exports.del=del,exports.clear=clear,exports.keys=keys,exports.close=close; |
@@ -17,3 +17,3 @@ 'use strict'; | ||
this._dbp = new Promise((resolve, reject) => { | ||
const openreq = indexedDB.open(this._dbName, 1); | ||
const openreq = indexedDB.open(this._dbName); | ||
openreq.onerror = () => reject(openreq.error); | ||
@@ -20,0 +20,0 @@ openreq.onsuccess = () => resolve(openreq.result); |
@@ -1,1 +0,1 @@ | ||
"use strict";var _createClass=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var idbKeyval=function(t){var e=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keyval-store",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"keyval";_classCallCheck(this,t),this.storeName=n,this._dbName=e,this._storeName=n,this._init()}return _createClass(t,[{key:"_init",value:function(){var t=this;this._dbp||(this._dbp=new Promise(function(e,n){var r=indexedDB.open(t._dbName,1);r.onerror=function(){return n(r.error)},r.onsuccess=function(){return e(r.result)},r.onupgradeneeded=function(){r.result.createObjectStore(t._storeName)}}))}},{key:"_withIDBStore",value:function(t,e){var n=this;return this._init(),this._dbp.then(function(r){return new Promise(function(o,i){var u=r.transaction(n.storeName,t);u.oncomplete=function(){return o()},u.onabort=u.onerror=function(){return i(u.error)},e(u.objectStore(n.storeName))})})}},{key:"_close",value:function(){var t=this;return this._init(),this._dbp.then(function(e){e.close(),t._dbp=void 0})}}]),t}(),n=void 0;function r(){return n||(n=new e),n}return t.Store=e,t.get=function(t){var e=void 0;return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:r())._withIDBStore("readwrite",function(n){e=n.get(t)}).then(function(){return e.result})},t.set=function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:r())._withIDBStore("readwrite",function(n){n.put(e,t)})},t.update=function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:r())._withIDBStore("readwrite",function(n){var r=n.get(t);r.onsuccess=function(){n.put(e(r.result),t)}})},t.del=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:r())._withIDBStore("readwrite",function(e){e.delete(t)})},t.clear=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:r())._withIDBStore("readwrite",function(t){t.clear()})},t.keys=function(){var t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:r())._withIDBStore("readwrite",function(e){(e.openKeyCursor||e.openCursor).call(e).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(function(){return t})},t.close=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:r())._close()},t}({}); | ||
"use strict";var _createClass=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var idbKeyval=function(t){var e=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keyval-store",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"keyval";_classCallCheck(this,t),this.storeName=n,this._dbName=e,this._storeName=n,this._init()}return _createClass(t,[{key:"_init",value:function(){var t=this;this._dbp||(this._dbp=new Promise(function(e,n){var r=indexedDB.open(t._dbName);r.onerror=function(){return n(r.error)},r.onsuccess=function(){return e(r.result)},r.onupgradeneeded=function(){r.result.createObjectStore(t._storeName)}}))}},{key:"_withIDBStore",value:function(t,e){var n=this;return this._init(),this._dbp.then(function(r){return new Promise(function(o,i){var u=r.transaction(n.storeName,t);u.oncomplete=function(){return o()},u.onabort=u.onerror=function(){return i(u.error)},e(u.objectStore(n.storeName))})})}},{key:"_close",value:function(){var t=this;return this._init(),this._dbp.then(function(e){e.close(),t._dbp=void 0})}}]),t}(),n=void 0;function r(){return n||(n=new e),n}return t.Store=e,t.get=function(t){var e=void 0;return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:r())._withIDBStore("readwrite",function(n){e=n.get(t)}).then(function(){return e.result})},t.set=function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:r())._withIDBStore("readwrite",function(n){n.put(e,t)})},t.update=function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:r())._withIDBStore("readwrite",function(n){var r=n.get(t);r.onsuccess=function(){n.put(e(r.result),t)}})},t.del=function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:r())._withIDBStore("readwrite",function(e){e.delete(t)})},t.clear=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:r())._withIDBStore("readwrite",function(t){t.clear()})},t.keys=function(){var t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:r())._withIDBStore("readwrite",function(e){(e.openKeyCursor||e.openCursor).call(e).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(function(){return t})},t.close=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:r())._close()},t}({}); |
@@ -16,3 +16,3 @@ var idbKeyval = (function (exports) { | ||
this._dbp = new Promise((resolve, reject) => { | ||
const openreq = indexedDB.open(this._dbName, 1); | ||
const openreq = indexedDB.open(this._dbName); | ||
openreq.onerror = () => reject(openreq.error); | ||
@@ -19,0 +19,0 @@ openreq.onsuccess = () => resolve(openreq.result); |
@@ -1,1 +0,1 @@ | ||
var idbKeyval=function(e){"use strict";class t{constructor(e="keyval-store",t="keyval"){this.storeName=t,this._dbName=e,this._storeName=t,this._init()}_init(){this._dbp||(this._dbp=new Promise((e,t)=>{const r=indexedDB.open(this._dbName,1);r.onerror=(()=>t(r.error)),r.onsuccess=(()=>e(r.result)),r.onupgradeneeded=(()=>{r.result.createObjectStore(this._storeName)})}))}_withIDBStore(e,t){return this._init(),this._dbp.then(r=>new Promise((n,o)=>{const s=r.transaction(this.storeName,e);s.oncomplete=(()=>n()),s.onabort=s.onerror=(()=>o(s.error)),t(s.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(e=>{e.close(),this._dbp=void 0})}}let r;function n(){return r||(r=new t),r}return e.Store=t,e.get=function(e,t=n()){let r;return t._withIDBStore("readwrite",t=>{r=t.get(e)}).then(()=>r.result)},e.set=function(e,t,r=n()){return r._withIDBStore("readwrite",r=>{r.put(t,e)})},e.update=function(e,t,r=n()){return r._withIDBStore("readwrite",r=>{const n=r.get(e);n.onsuccess=(()=>{r.put(t(n.result),e)})})},e.del=function(e,t=n()){return t._withIDBStore("readwrite",t=>{t.delete(e)})},e.clear=function(e=n()){return e._withIDBStore("readwrite",e=>{e.clear()})},e.keys=function(e=n()){const t=[];return e._withIDBStore("readwrite",e=>{(e.openKeyCursor||e.openCursor).call(e).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)},e.close=function(e=n()){return e._close()},e}({}); | ||
var idbKeyval=function(e){"use strict";class t{constructor(e="keyval-store",t="keyval"){this.storeName=t,this._dbName=e,this._storeName=t,this._init()}_init(){this._dbp||(this._dbp=new Promise((e,t)=>{const r=indexedDB.open(this._dbName);r.onerror=(()=>t(r.error)),r.onsuccess=(()=>e(r.result)),r.onupgradeneeded=(()=>{r.result.createObjectStore(this._storeName)})}))}_withIDBStore(e,t){return this._init(),this._dbp.then(r=>new Promise((n,o)=>{const s=r.transaction(this.storeName,e);s.oncomplete=(()=>n()),s.onabort=s.onerror=(()=>o(s.error)),t(s.objectStore(this.storeName))}))}_close(){return this._init(),this._dbp.then(e=>{e.close(),this._dbp=void 0})}}let r;function n(){return r||(r=new t),r}return e.Store=t,e.get=function(e,t=n()){let r;return t._withIDBStore("readwrite",t=>{r=t.get(e)}).then(()=>r.result)},e.set=function(e,t,r=n()){return r._withIDBStore("readwrite",r=>{r.put(t,e)})},e.update=function(e,t,r=n()){return r._withIDBStore("readwrite",r=>{const n=r.get(e);n.onsuccess=(()=>{r.put(t(n.result),e)})})},e.del=function(e,t=n()){return t._withIDBStore("readwrite",t=>{t.delete(e)})},e.clear=function(e=n()){return e._withIDBStore("readwrite",e=>{e.clear()})},e.keys=function(e=n()){const t=[];return e._withIDBStore("readwrite",e=>{(e.openKeyCursor||e.openCursor).call(e).onsuccess=function(){this.result&&(t.push(this.result.key),this.result.continue())}}).then(()=>t)},e.close=function(e=n()){return e._close()},e}({}); |
@@ -17,3 +17,3 @@ export class Store { | ||
this._dbp = new Promise((resolve, reject) => { | ||
const openreq = indexedDB.open(this._dbName, 1); | ||
const openreq = indexedDB.open(this._dbName); | ||
openreq.onerror = () => reject(openreq.error); | ||
@@ -20,0 +20,0 @@ openreq.onsuccess = () => resolve(openreq.result); |
{ | ||
"publishConfig": { | ||
"access": "public" | ||
"access": "public" | ||
}, | ||
"name": "@isomorphic-git/idb-keyval", | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"description": "A super-simple-small keyval store built on top of IndexedDB", | ||
@@ -8,0 +8,0 @@ "main": "./dist/idb-keyval-cjs.js", |
Sorry, the diff of this file is not supported yet
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
32235