Skip to content

Commit

Permalink
fix: revert to use process.browser
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Jun 14, 2022
1 parent bd51302 commit 31c485b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const plugins = (options = { browser: false }) => {
replace({
preventAssignment: true,
values: {
'rollupProcess.browser': options.browser
'process.browser': options.browser
}
}),
commonjs({ extensions: ['.js', '.ts'] }),
Expand Down
4 changes: 2 additions & 2 deletions src/parser/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ declare let require: Function;
declare let global: any;
declare const self: unknown;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare let rollupProcess: any; // Used by @rollup/plugin-replace
declare let process: any; // Used by @rollup/plugin-replace

const detectRandomBytes = (): RandomBytesFunction => {
if (rollupProcess.browser) {
if (process.browser) {
if (typeof window !== 'undefined') {
// browser crypto implementation(s)
const target = window.crypto || window.msCrypto; // allow for IE11
Expand Down

0 comments on commit 31c485b

Please sign in to comment.