From 60c75557de2873cebaa3a8b83f81ad95663bc2b4 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Mon, 18 Oct 2021 07:33:01 +0300 Subject: [PATCH] Rollback require changes for crypto --- index.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/index.ts b/index.ts index b0e9028..d904e5b 100644 --- a/index.ts +++ b/index.ts @@ -63,13 +63,9 @@ function isWithinCurveOrder(num: bigint): boolean { const crypto: { node?: any; web?: Crypto } = (() => { const webCrypto = typeof self === 'object' && 'crypto' in self ? self.crypto : undefined; - // Silence webpack warnings - const nodeRequire = - typeof module !== 'undefined' && - typeof module.require === 'function' && - module.require.bind(module); + const nodeRequire = typeof module !== 'undefined' && typeof require === 'function'; return { - node: nodeRequire && !webCrypto ? nodeRequire('crypto') : undefined, + node: nodeRequire && !webCrypto ? require('crypto') : undefined, web: webCrypto, }; })();