From a67120ec2e716f955e8da1249d9e3e2e36b915d3 Mon Sep 17 00:00:00 2001 From: colemanw Date: Thu, 25 May 2023 07:40:59 -0400 Subject: [PATCH] APIv4 Explorer - Fix trailing whitespace --- ang/api4Explorer/Explorer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ang/api4Explorer/Explorer.js b/ang/api4Explorer/Explorer.js index 894de01ef3..5f031ca28b 100644 --- a/ang/api4Explorer/Explorer.js +++ b/ang/api4Explorer/Explorer.js @@ -1025,7 +1025,8 @@ } $.each(val, function(k, v) { var ts = localizable && localizable.includes(k) && _.isString(v) && v.length ? 'E::ts(' : ''; - ret += (ret ? ', ' : '') + newLine + indent + "'" + k + "' => " + ts + phpFormat(v, indentChild, indentChildren, localizable) + (ts ? ')' : ''); + var leadingComma = !ret ? '' : (newLine ? ',' : ', '); + ret += leadingComma + newLine + indent + "'" + k + "' => " + ts + phpFormat(v, indentChild, indentChildren, localizable) + (ts ? ')' : ''); }); return '[' + ret + trailingComma + newLine + baseLine + ']'; } @@ -1034,7 +1035,8 @@ return '[]'; } $.each(val, function(k, v) { - ret += (ret ? ', ' : '') + newLine + indent + phpFormat(v, indentChild, indentChildren, localizable); + var leadingComma = !ret ? '' : (newLine ? ',' : ', '); + ret += leadingComma + newLine + indent + phpFormat(v, indentChild, indentChildren, localizable); }); return '[' + ret + trailingComma + newLine + baseLine + ']'; } -- 2.25.1