Skip to content

Commit 0247fdc

Browse files
committed
fix: improved function display, fix #1852
1 parent 0c78611 commit 0247fdc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/shared-utils/src/util.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,14 @@ export function getCustomFunctionDetails (func: Function): CustomState {
353353
// Trim any excess whitespace from the argument string
354354
const match = matches && matches[0]
355355
const args = typeof match === 'string'
356-
? `(${match.substring(1, match.length - 2).split(',').map(a => a.trim()).join(', ')})`
356+
? match
357357
: '(?)'
358358
const name = typeof func.name === 'string' ? func.name : ''
359359
return {
360360
_custom: {
361361
type: 'function',
362-
display: `<span>f</span> ${escape(name)}${args}`,
362+
display: `<span style="opacity:.5;">function</span> ${escape(name)}${args}`,
363+
tooltip: string.trim() ? `<pre>${string}</pre>` : null,
363364
_reviveId: reviveCache.cache(func),
364365
},
365366
}

0 commit comments

Comments
 (0)