@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 CHANGED
@@ -64055,41 +64055,43 @@ function memoryFetch(_x, _x2) {
64055
64055
 
64056
64056
  function _memoryFetch() {
64057
64057
  _memoryFetch = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, type) {
64058
- var element;
64058
+ var key, element;
64059
64059
  return regeneratorRuntime.wrap(function _callee$(_context) {
64060
64060
  while (1) {
64061
64061
  switch (_context.prev = _context.next) {
64062
64062
  case 0:
64063
+ key = web3Utils__default["default"].sha3(url);
64064
+
64063
64065
  try {
64064
- element = JSON.parse(window.localStorage.getItem(url));
64066
+ element = JSON.parse(window.localStorage.getItem(key));
64065
64067
  } catch (e) {}
64066
64068
 
64067
64069
  if (!element) {
64068
- _context.next = 3;
64070
+ _context.next = 4;
64069
64071
  break;
64070
64072
  }
64071
64073
 
64072
64074
  return _context.abrupt("return", element);
64073
64075
 
64074
- case 3:
64075
- _context.next = 5;
64076
+ case 4:
64077
+ _context.next = 6;
64076
64078
  return fetch(url);
64077
64079
 
64078
- case 5:
64080
+ case 6:
64079
64081
  element = _context.sent;
64080
- _context.next = 8;
64082
+ _context.next = 9;
64081
64083
  return element[type || 'json']();
64082
64084
 
64083
- case 8:
64085
+ case 9:
64084
64086
  element = _context.sent;
64085
64087
 
64086
64088
  try {
64087
- window.localStorage.setItem(url, JSON.stringify(element));
64089
+ window.localStorage.setItem(key, JSON.stringify(element));
64088
64090
  } catch (e) {}
64089
64091
 
64090
64092
  return _context.abrupt("return", element);
64091
64093
 
64092
- case 11:
64094
+ case 12:
64093
64095
  case "end":
64094
64096
  return _context.stop();
64095
64097
  }