Skip to content

Commit

Permalink
fix: avoid depending on node process (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
pantajoe authored May 17, 2021
1 parent 9cea5a2 commit a3231b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const escaped: Record<string, string> = {
};
const objectProtoOwnPropertyNames = Object.getOwnPropertyNames(Object.prototype).sort().join('\0');
// workaround to disable warnings, see https://github.com/nuxt/nuxt.js/issues/4026 for details
const defaultLogLevel = process.env.NUXT_ENV_DEVALUE_LOG_LEVEL || 'warn';
const logLimit = parseInt(process.env.NUXT_ENV_DEVALUE_LOG_LIMIT) || 99;
const defaultLogLevel = typeof process !== 'undefined' ? process.env.NUXT_ENV_DEVALUE_LOG_LEVEL || 'warn' : 'warn';
const logLimit = typeof process !== 'undefined' ? parseInt(process.env.NUXT_ENV_DEVALUE_LOG_LIMIT) || 99 : 99;


export default function devalue(value: any, level = defaultLogLevel) {
Expand Down

0 comments on commit a3231b0

Please sign in to comment.