@ethereansos/interfaces-core 0.4.146 → 0.4.147
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs.js +6 -27
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6 -27
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
@@ -64058,9 +64058,14 @@ window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.ms
|
|
64058
64058
|
var dbName = 'ethereansos';
|
64059
64059
|
var dbTable = 'ethereansos';
|
64060
64060
|
var dbVersion = 1;
|
64061
|
+
var internalDB;
|
64061
64062
|
|
64062
64063
|
function openDB(name, version) {
|
64063
64064
|
return new Promise(function (ok, ko) {
|
64065
|
+
if (internalDB) {
|
64066
|
+
return ok(internalDB);
|
64067
|
+
}
|
64068
|
+
|
64064
64069
|
var request = dbEngine.open(name, version);
|
64065
64070
|
|
64066
64071
|
request.onerror = function (event) {
|
@@ -64068,7 +64073,7 @@ function openDB(name, version) {
|
|
64068
64073
|
};
|
64069
64074
|
|
64070
64075
|
request.onsuccess = function (event) {
|
64071
|
-
return ok(event.target.result);
|
64076
|
+
return ok(internalDB = event.target.result);
|
64072
64077
|
};
|
64073
64078
|
|
64074
64079
|
request.onupgradeneeded = function (event) {
|
@@ -64082,24 +64087,6 @@ function openDB(name, version) {
|
|
64082
64087
|
});
|
64083
64088
|
}
|
64084
64089
|
|
64085
|
-
function closeDB(db) {
|
64086
|
-
return new Promise(function (ok, ko) {
|
64087
|
-
var request = db.close();
|
64088
|
-
|
64089
|
-
if (!request) {
|
64090
|
-
return ok();
|
64091
|
-
}
|
64092
|
-
|
64093
|
-
request.onerror = function (event) {
|
64094
|
-
return ko(event.target.errorCode);
|
64095
|
-
};
|
64096
|
-
|
64097
|
-
request.onsuccess = function (event) {
|
64098
|
-
return ok(event.target.result);
|
64099
|
-
};
|
64100
|
-
});
|
64101
|
-
}
|
64102
|
-
|
64103
64090
|
function setItem(key, value) {
|
64104
64091
|
return new Promise( /*#__PURE__*/function () {
|
64105
64092
|
var _ref = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(ok, ko) {
|
@@ -64133,10 +64120,6 @@ function setItem(key, value) {
|
|
64133
64120
|
while (1) {
|
64134
64121
|
switch (_context.prev = _context.next) {
|
64135
64122
|
case 0:
|
64136
|
-
_context.next = 2;
|
64137
|
-
return closeDB(db);
|
64138
|
-
|
64139
|
-
case 2:
|
64140
64123
|
case "end":
|
64141
64124
|
return _context.stop();
|
64142
64125
|
}
|
@@ -64191,10 +64174,6 @@ function getItem(key) {
|
|
64191
64174
|
while (1) {
|
64192
64175
|
switch (_context3.prev = _context3.next) {
|
64193
64176
|
case 0:
|
64194
|
-
_context3.next = 2;
|
64195
|
-
return closeDB(db);
|
64196
|
-
|
64197
|
-
case 2:
|
64198
64177
|
case "end":
|
64199
64178
|
return _context3.stop();
|
64200
64179
|
}
|