Skip to content

Commit

Permalink
default obj = {}
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmehta committed Mar 10, 2019
1 parent 0337212 commit 2681c77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ names.forEach(function (name) {
if (logEnded) console.log('STREAM ENDED BEFORE:', msg)
// allows for args in any order..
let tmp
if (msg && typeof msg === 'object') {
if (obj && typeof obj === 'string') {
// args are reversed.. swap them
tmp = msg
msg = obj
obj = tmp
}
obj = obj || {}
// default log values
Object.assign(obj, {
env: process.env.NODE_ENV,
Expand Down

0 comments on commit 2681c77

Please sign in to comment.