From: colemanw Date: Thu, 25 May 2023 11:40:59 +0000 (-0400) Subject: APIv4 Explorer - Fix trailing whitespace X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a67120ec2e716f955e8da1249d9e3e2e36b915d3;p=civicrm-core.git APIv4 Explorer - Fix trailing whitespace --- 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 + ']'; }