@lit-protocol/nacl
Advanced tools
Comparing version 2.0.33 to 2.0.34
{ | ||
"name": "@lit-protocol/nacl", | ||
"version": "2.0.33", | ||
"version": "2.0.34", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "tags": [ |
@@ -1168,3 +1168,13 @@ "use strict"; | ||
// Node.js. | ||
crypto = require('crypto'); | ||
// this nodeRequire hack was added by Chris Cassano | ||
// because webpack was complaining that "you might try to require crypto and that's not bundled" by webpack automatically anymore. | ||
// but this code path will only run on nodejs so it's a non-issue. | ||
// thus we have this hack to make webpack happy. | ||
const nodeVer = typeof process !== 'undefined' && process.versions?.node; | ||
const nodeRequire = nodeVer | ||
? typeof __webpack_require__ === 'function' | ||
? __non_webpack_require__ | ||
: require | ||
: undefined; | ||
crypto = nodeRequire('crypto'); | ||
if (crypto && crypto.randomBytes) { | ||
@@ -1171,0 +1181,0 @@ _nacl.setPRNG(function (x, n) { |
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
98028
1197
2