Merge pull request #1660 from 0xProject/bug/log-utils-process

Check for process in browser environments
This commit is contained in:
Jacob Evans
2019-02-28 16:45:54 -05:00
committed by GitHub
2 changed files with 10 additions and 1 deletions

View File

@@ -1,4 +1,13 @@
[
{
"version": "4.2.2",
"changes": [
{
"note": "Fix issue where process is not defined in browser context",
"pr": 1660
}
]
},
{
"timestamp": 1551220833,
"version": "4.2.1",

View File

@@ -2,7 +2,7 @@ import chalk from 'chalk';
import * as _ from 'lodash';
const DEFAULT_TERMINAL_WIDTH = 80;
const TERMINAL_WIDTH = process.stdout.columns || DEFAULT_TERMINAL_WIDTH;
const TERMINAL_WIDTH = _.get(process, 'stdout.columns') || DEFAULT_TERMINAL_WIDTH;
export const logUtils = {
log(...args: any[]): void {