diff --git a/src/consola.js b/src/consola.js index 25b830e9..7c55d918 100644 --- a/src/consola.js +++ b/src/consola.js @@ -73,9 +73,7 @@ export default class Consola { } } else { // [obj] - if (typeof arg1 === 'object') { - assignToLogObj(logObj, arg1) - } + assignToLogObj(logObj, arg1) } // Log diff --git a/src/utils.js b/src/utils.js index 8491de9c..a87e8e94 100644 --- a/src/utils.js +++ b/src/utils.js @@ -4,6 +4,9 @@ const VALID_LOGOBJ_KEYS = [ ] export function assignToLogObj (logObj, obj) { + if (typeof obj !== 'object') { + return + } for (const key of VALID_LOGOBJ_KEYS) { const val = obj[key] if (typeof val !== 'undefined') {