1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-01 16:13:00 +00:00

"dedupe" and "raw" suffixes for enlist-input operator (#5152)

Includes unit tests.
This commit is contained in:
Robin Munn
2020-12-01 00:52:46 +07:00
committed by GitHub
parent 8fc6910c03
commit fd3e77d38f
4 changed files with 10 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ exports.split = makeStringBinaryOperator(
);
exports["enlist-input"] = makeStringBinaryOperator(
function(a) {return $tw.utils.parseStringArray("" + a);}
function(a,o,s) {return $tw.utils.parseStringArray("" + a,(s === "raw"));}
);
exports.join = makeStringReducingOperator(
@@ -78,7 +78,7 @@ function makeStringBinaryOperator(fnCalc) {
return function(source,operator,options) {
var result = [];
source(function(tiddler,title) {
Array.prototype.push.apply(result,fnCalc(title,operator.operand || ""));
Array.prototype.push.apply(result,fnCalc(title,operator.operand || "",operator.suffix || ""));
});
return result;
};