From c4359d572abd329be7a56eb9c2c05dac62a9e6ac Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Wed, 11 Mar 2020 19:11:00 -0400 Subject: [PATCH] fix(stringify): improve types to get full coverage --- src/lib/format/log.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/format/log.ts b/src/lib/format/log.ts index 79626cff..e3a76652 100644 --- a/src/lib/format/log.ts +++ b/src/lib/format/log.ts @@ -30,8 +30,7 @@ export const stringify = (value: any, spacing = defaultStringifySpacing) => // eslint-disable-next-line complexity (_, item) => { const type = typeof item; - const name = - type === 'object' ? (item.constructor?.name as string) : type; + const name = type === 'object' ? (item as object).constructor.name : type; switch (name) { case 'Uint8Array': return ``; @@ -40,7 +39,6 @@ export const stringify = (value: any, spacing = defaultStringifySpacing) => case 'function': case 'symbol': return `<${name}: ${(item as symbol | Function).toString()}>`; - default: return item; }