Extend the enlist operator to optionally not de-duplicate

This commit is contained in:
Jeremy Ruston
2019-06-10 17:54:46 +01:00
parent 37bb75f0cf
commit 18fe112da7
3 changed files with 17 additions and 4 deletions
+10 -1
View File
@@ -16,7 +16,16 @@ Filter operator returning its operand parsed as a list
Export our filter function
*/
exports.enlist = function(source,operator,options) {
var list = $tw.utils.parseStringArray(operator.operand);
var allowDuplicates = false;
switch(operator.suffix) {
case "raw":
allowDuplicates = true;
break;
case "dedupe":
allowDuplicates = false;
break;
}
var list = $tw.utils.parseStringArray(operator.operand,allowDuplicates);
if(operator.prefix === "!") {
var results = [];
source(function(tiddler,title) {