Extend enlist/enlist-input to recognise "all" suffix

This commit is contained in:
Jeremy Ruston
2026-01-31 18:19:19 +00:00
parent d2faad2c58
commit b6106ee4d9
4 changed files with 5 additions and 3 deletions

View File

@@ -16,6 +16,8 @@ exports.enlist = function(source,operator,options) {
var allowDuplicates = false;
switch(operator.suffix) {
case "raw":
// Intentional fallthrough
case "all":
allowDuplicates = true;
break;
case "dedupe":

View File

@@ -58,7 +58,7 @@ exports.split = makeStringBinaryOperator(
);
exports["enlist-input"] = makeStringBinaryOperator(
function(a,o,s) {return $tw.utils.parseStringArray("" + a,(s === "raw"));}
function(a,o,s) {return $tw.utils.parseStringArray("" + a,(s === "raw" || s === "all"));}
);
exports.join = makeStringReducingOperator(

View File

@@ -8,7 +8,7 @@ op-output: the titles stored as a [[title list|Title List]] at <<.place L>>
op-parameter: a [[title list|Title List]]
op-parameter-name: L
op-purpose: select titles from the parameter interpreted as a [[title list|Title List]]
op-suffix: <<.from-version "5.1.20">> `dedupe` (the default) to remove duplicates, `raw` to leave duplicates untouched
op-suffix: <<.from-version "5.1.20">> `dedupe` (the default) to remove duplicates, `all` (or `raw`) to leave duplicates untouched
op-suffix-name: D
tags: [[Filter Operators]] [[Field Operators]] [[Selection Constructors]] [[Negatable Operators]]
title: enlist Operator

View File

@@ -4,7 +4,7 @@ modified: 20201102221854719
op-input: a [[selection of titles|Title Selection]]
op-output: the titles stored as a [[title list|Title List]] in each input title
op-purpose: select titles by interpreting each input title as a [[title list|Title List]]
op-suffix: `dedupe` (the default) to remove duplicates, `raw` to leave duplicates untouched
op-suffix: `dedupe` (the default) to remove duplicates, `all` (or `raw`) to leave duplicates untouched
op-suffix-name: D
tags: [[Filter Operators]] [[String Operators]]
title: enlist-input Operator