From 926e7ed702934963a21212472a55d30e509832cf Mon Sep 17 00:00:00 2001 From: Ed S Date: Thu, 25 Apr 2024 12:57:37 +0100 Subject: [PATCH] Simplify conversion of undefined to empty string --- index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/index.js b/index.js index 7d4f31b..833fb9d 100644 --- a/index.js +++ b/index.js @@ -129,16 +129,13 @@ exports.handlers = { ( d.hierarchy && d.hierarchy.length > 0 ) ) ) { - d.description = d.description === undefined ? '' : d.description; - // Otherwise, using += appends 'undefined' as a string - d.description = '
' + html + '
' + d.description; + '">' + html + '' + ( d.description || '' ); } } });