Joining an empty list should return an empty list (#4853)

This commit is contained in:
Robin Munn
2020-09-24 18:37:51 +01:00
committed by GitHub
parent 72c07a3f81
commit d5cf4112fa
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -90,6 +90,9 @@ function makeStringReducingOperator(fnCalc,initialValue) {
source(function(tiddler,title) {
result.push(title);
});
if(result.length === 0) {
return [];
}
return [result.reduce(function(accumulator,currentValue) {
return fnCalc(accumulator,currentValue,operator.operand || "");
},initialValue) || ""];