Skip to content

Commit

Permalink
Check for process before accessing
Browse files Browse the repository at this point in the history
  • Loading branch information
bre7 authored Jul 24, 2020
1 parent 4a0bc7b commit 449e510
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/default-encoding.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var defaultEncoding
/* istanbul ignore next */
if (process.browser) {
if (global.process && global.process.browser) {
defaultEncoding = 'utf-8'
} else if (process.version) {
} else if (global.process && global.process.version) {
var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)

This comment has been minimized.

Copy link
@kuroky360

kuroky360 Jan 20, 2022

process.version has not been modified


defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
Expand Down

0 comments on commit 449e510

Please # to comment.