Skip to content

Commit

Permalink
Merge pull request #38 from dead-horse/dont-warn-in-node
Browse files Browse the repository at this point in the history
feat: don't use console.warn in node env
  • Loading branch information
yiminghe committed Apr 24, 2017
2 parents 08f67ea + 7e1f45f commit 1a72c0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const formatRegExp = /%[sdj%]/g;
let warning2 = () => {
};

if (process.env.NODE_ENV !== 'production') {
// don't print warning message when in production env or node runtime
if (process.env.NODE_ENV !== 'production' && typeof global === 'undefined') {
warning2 = (type, message) => {
if (typeof console !== 'undefined' && console.warn) {
console.warn(type, message);
Expand Down

0 comments on commit 1a72c0e

Please sign in to comment.