@ethereansos/interfaces-core 0.4.143 → 0.4.144
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs.js +12 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +12 -10
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -64043,41 +64043,43 @@ function memoryFetch(_x, _x2) {
|
|
64043
64043
|
|
64044
64044
|
function _memoryFetch() {
|
64045
64045
|
_memoryFetch = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, type) {
|
64046
|
-
var element;
|
64046
|
+
var key, element;
|
64047
64047
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
64048
64048
|
while (1) {
|
64049
64049
|
switch (_context.prev = _context.next) {
|
64050
64050
|
case 0:
|
64051
|
+
key = web3Utils.sha3(url);
|
64052
|
+
|
64051
64053
|
try {
|
64052
|
-
element = JSON.parse(window.localStorage.getItem(
|
64054
|
+
element = JSON.parse(window.localStorage.getItem(key));
|
64053
64055
|
} catch (e) {}
|
64054
64056
|
|
64055
64057
|
if (!element) {
|
64056
|
-
_context.next =
|
64058
|
+
_context.next = 4;
|
64057
64059
|
break;
|
64058
64060
|
}
|
64059
64061
|
|
64060
64062
|
return _context.abrupt("return", element);
|
64061
64063
|
|
64062
|
-
case
|
64063
|
-
_context.next =
|
64064
|
+
case 4:
|
64065
|
+
_context.next = 6;
|
64064
64066
|
return fetch(url);
|
64065
64067
|
|
64066
|
-
case
|
64068
|
+
case 6:
|
64067
64069
|
element = _context.sent;
|
64068
|
-
_context.next =
|
64070
|
+
_context.next = 9;
|
64069
64071
|
return element[type || 'json']();
|
64070
64072
|
|
64071
|
-
case
|
64073
|
+
case 9:
|
64072
64074
|
element = _context.sent;
|
64073
64075
|
|
64074
64076
|
try {
|
64075
|
-
window.localStorage.setItem(
|
64077
|
+
window.localStorage.setItem(key, JSON.stringify(element));
|
64076
64078
|
} catch (e) {}
|
64077
64079
|
|
64078
64080
|
return _context.abrupt("return", element);
|
64079
64081
|
|
64080
|
-
case
|
64082
|
+
case 12:
|
64081
64083
|
case "end":
|
64082
64084
|
return _context.stop();
|
64083
64085
|
}
|