Skip to content

Commit

Permalink
refactor: remove unnecessary condition (#5520)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Apr 10, 2024
1 parent 6157282 commit fc26f56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/utils/src/display.ts
Expand Up @@ -113,7 +113,7 @@ export function objDisplay(obj: unknown, options: LoupeOptions = {}): string {
if (options.truncate && str.length >= options.truncate) {
if (type === '[object Function]') {
const fn = obj as () => void
return (!fn.name || fn.name === '')
return !fn.name
? '[Function]'
: `[Function: ${fn.name}]`
}
Expand Down

0 comments on commit fc26f56

Please sign in to comment.