mol_crypto_lib 0.1.1081 → 0.1.1082

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/node.mjs CHANGED
@@ -1655,7 +1655,10 @@ var $node = new Proxy({ require }, {
1655
1655
  }
1656
1656
  catch (error) {
1657
1657
  if (error.code === 'ERR_REQUIRE_ESM') {
1658
- return importSync(name);
1658
+ const module = cache.get(name);
1659
+ if (module)
1660
+ return module;
1661
+ throw import(name).then(module => cache.set(name, module));
1659
1662
  }
1660
1663
  $.$mol_fail_log(error);
1661
1664
  return null;
@@ -1666,8 +1669,7 @@ var $node = new Proxy({ require }, {
1666
1669
  return true;
1667
1670
  },
1668
1671
  });
1669
- const importAsync = async (uri) => import(uri);
1670
- const importSync = $.$mol_wire_sync(importAsync);
1672
+ const cache = new Map();
1671
1673
  require = (req => Object.assign(function require(name) {
1672
1674
  return $node[name];
1673
1675
  }, req))(require);
@@ -2287,6 +2289,7 @@ var $;
2287
2289
  return $mol_crypto_native.getRandomValues(new Uint8Array(16));
2288
2290
  }
2289
2291
  $.$mol_crypto_salt = $mol_crypto_salt;
2292
+ $.$mol_crypto_salt_once = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6]);
2290
2293
  })($ || ($ = {}));
2291
2294
 
2292
2295
 
package/node.test.js CHANGED
@@ -1646,7 +1646,10 @@ var $node = new Proxy({ require }, {
1646
1646
  }
1647
1647
  catch (error) {
1648
1648
  if (error.code === 'ERR_REQUIRE_ESM') {
1649
- return importSync(name);
1649
+ const module = cache.get(name);
1650
+ if (module)
1651
+ return module;
1652
+ throw import(name).then(module => cache.set(name, module));
1650
1653
  }
1651
1654
  $.$mol_fail_log(error);
1652
1655
  return null;
@@ -1657,8 +1660,7 @@ var $node = new Proxy({ require }, {
1657
1660
  return true;
1658
1661
  },
1659
1662
  });
1660
- const importAsync = async (uri) => import(uri);
1661
- const importSync = $.$mol_wire_sync(importAsync);
1663
+ const cache = new Map();
1662
1664
  require = (req => Object.assign(function require(name) {
1663
1665
  return $node[name];
1664
1666
  }, req))(require);
@@ -2278,6 +2280,7 @@ var $;
2278
2280
  return $mol_crypto_native.getRandomValues(new Uint8Array(16));
2279
2281
  }
2280
2282
  $.$mol_crypto_salt = $mol_crypto_salt;
2283
+ $.$mol_crypto_salt_once = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6]);
2281
2284
  })($ || ($ = {}));
2282
2285
 
2283
2286
  ;