Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
Rollback require changes for crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Oct 18, 2021
1 parent e98c8be commit 60c7555
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
})();
Expand Down

0 comments on commit 60c7555

Please sign in to comment.