@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.esm.js
CHANGED
@@ -64046,9 +64046,14 @@ window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.ms
|
|
64046
64046
|
var dbName = 'ethereansos';
|
64047
64047
|
var dbTable = 'ethereansos';
|
64048
64048
|
var dbVersion = 1;
|
64049
|
+
var internalDB;
|
64049
64050
|
|
64050
64051
|
function openDB(name, version) {
|
64051
64052
|
return new Promise(function (ok, ko) {
|
64053
|
+
if (internalDB) {
|
64054
|
+
return ok(internalDB);
|
64055
|
+
}
|
64056
|
+
|
64052
64057
|
var request = dbEngine.open(name, version);
|
64053
64058
|
|
64054
64059
|
request.onerror = function (event) {
|
@@ -64056,7 +64061,7 @@ function openDB(name, version) {
|
|
64056
64061
|
};
|
64057
64062
|
|
64058
64063
|
request.onsuccess = function (event) {
|
64059
|
-
return ok(event.target.result);
|
64064
|
+
return ok(internalDB = event.target.result);
|
64060
64065
|
};
|
64061
64066
|
|
64062
64067
|
request.onupgradeneeded = function (event) {
|
@@ -64070,24 +64075,6 @@ function openDB(name, version) {
|
|
64070
64075
|
});
|
64071
64076
|
}
|
64072
64077
|
|
64073
|
-
function closeDB(db) {
|
64074
|
-
return new Promise(function (ok, ko) {
|
64075
|
-
var request = db.close();
|
64076
|
-
|
64077
|
-
if (!request) {
|
64078
|
-
return ok();
|
64079
|
-
}
|
64080
|
-
|
64081
|
-
request.onerror = function (event) {
|
64082
|
-
return ko(event.target.errorCode);
|
64083
|
-
};
|
64084
|
-
|
64085
|
-
request.onsuccess = function (event) {
|
64086
|
-
return ok(event.target.result);
|
64087
|
-
};
|
64088
|
-
});
|
64089
|
-
}
|
64090
|
-
|
64091
64078
|
function setItem(key, value) {
|
64092
64079
|
return new Promise( /*#__PURE__*/function () {
|
64093
64080
|
var _ref = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(ok, ko) {
|
@@ -64121,10 +64108,6 @@ function setItem(key, value) {
|
|
64121
64108
|
while (1) {
|
64122
64109
|
switch (_context.prev = _context.next) {
|
64123
64110
|
case 0:
|
64124
|
-
_context.next = 2;
|
64125
|
-
return closeDB(db);
|
64126
|
-
|
64127
|
-
case 2:
|
64128
64111
|
case "end":
|
64129
64112
|
return _context.stop();
|
64130
64113
|
}
|
@@ -64179,10 +64162,6 @@ function getItem(key) {
|
|
64179
64162
|
while (1) {
|
64180
64163
|
switch (_context3.prev = _context3.next) {
|
64181
64164
|
case 0:
|
64182
|
-
_context3.next = 2;
|
64183
|
-
return closeDB(db);
|
64184
|
-
|
64185
|
-
case 2:
|
64186
64165
|
case "end":
|
64187
64166
|
return _context3.stop();
|
64188
64167
|
}
|