1
0
mirror of https://github.com/dzeiocom/libs.git synced 2025-04-23 03:12:12 +00:00

Fixed Undefined and null throwing error

Signed-off-by: Florian Bouillon <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2020-08-17 10:57:46 +02:00
parent f35468c497
commit 7e7c006ee6

View File

@ -372,6 +372,12 @@ export default class Logger implements Console {
if (typeof el === 'object') {
return el
}
if (el === undefined) {
return yellow('undefined')
}
if (el === null) {
return yellow('null')
}
return typeof el !== 'string' ? yellow(el.toString()) : green(el)
})
)