@@ -69,6 +69,8 @@ const TEST_STRINGS = {
69
69
70
70
// Filter operator
71
71
FILTER_OPERATOR : `{{ arr | length }}{{ 1 + arr | length }}{{ 2 + arr | sort | length }}{{ (arr | sort)[0] }}` ,
72
+ FILTER_OPERATOR_2 : `|{{ 'abc' | length }}|{{ 'aBcD' | upper }}|{{ 'aBcD' | lower }}|{{ 'test test' | capitalize}}|{{ 'test test' | title }}|{{ ' a b ' | trim }}|{{ ' A B ' | trim | lower | length }}|` ,
73
+ FILTER_OPERATOR_3 : `|{{ -1 | abs }}|{{ 1 | abs }}|` ,
72
74
73
75
// Logical operators between non-Booleans
74
76
BOOLEAN_NUMERICAL : `|{{ 1 and 2 }}|{{ 1 and 0 }}|{{ 0 and 1 }}|{{ 0 and 0 }}|{{ 1 or 2 }}|{{ 1 or 0 }}|{{ 0 or 1 }}|{{ 0 or 0 }}|{{ not 1 }}|{{ not 0 }}|` ,
@@ -1139,6 +1141,70 @@ const TEST_PARSED = {
1139
1141
{ value : "]" , type : "CloseSquareBracket" } ,
1140
1142
{ value : "}}" , type : "CloseExpression" } ,
1141
1143
] ,
1144
+ FILTER_OPERATOR_2 : [
1145
+ { value : "|" , type : "Text" } ,
1146
+ { value : "{{" , type : "OpenExpression" } ,
1147
+ { value : "abc" , type : "StringLiteral" } ,
1148
+ { value : "|" , type : "Pipe" } ,
1149
+ { value : "length" , type : "Identifier" } ,
1150
+ { value : "}}" , type : "CloseExpression" } ,
1151
+ { value : "|" , type : "Text" } ,
1152
+ { value : "{{" , type : "OpenExpression" } ,
1153
+ { value : "aBcD" , type : "StringLiteral" } ,
1154
+ { value : "|" , type : "Pipe" } ,
1155
+ { value : "upper" , type : "Identifier" } ,
1156
+ { value : "}}" , type : "CloseExpression" } ,
1157
+ { value : "|" , type : "Text" } ,
1158
+ { value : "{{" , type : "OpenExpression" } ,
1159
+ { value : "aBcD" , type : "StringLiteral" } ,
1160
+ { value : "|" , type : "Pipe" } ,
1161
+ { value : "lower" , type : "Identifier" } ,
1162
+ { value : "}}" , type : "CloseExpression" } ,
1163
+ { value : "|" , type : "Text" } ,
1164
+ { value : "{{" , type : "OpenExpression" } ,
1165
+ { value : "test test" , type : "StringLiteral" } ,
1166
+ { value : "|" , type : "Pipe" } ,
1167
+ { value : "capitalize" , type : "Identifier" } ,
1168
+ { value : "}}" , type : "CloseExpression" } ,
1169
+ { value : "|" , type : "Text" } ,
1170
+ { value : "{{" , type : "OpenExpression" } ,
1171
+ { value : "test test" , type : "StringLiteral" } ,
1172
+ { value : "|" , type : "Pipe" } ,
1173
+ { value : "title" , type : "Identifier" } ,
1174
+ { value : "}}" , type : "CloseExpression" } ,
1175
+ { value : "|" , type : "Text" } ,
1176
+ { value : "{{" , type : "OpenExpression" } ,
1177
+ { value : " a b " , type : "StringLiteral" } ,
1178
+ { value : "|" , type : "Pipe" } ,
1179
+ { value : "trim" , type : "Identifier" } ,
1180
+ { value : "}}" , type : "CloseExpression" } ,
1181
+ { value : "|" , type : "Text" } ,
1182
+ { value : "{{" , type : "OpenExpression" } ,
1183
+ { value : " A B " , type : "StringLiteral" } ,
1184
+ { value : "|" , type : "Pipe" } ,
1185
+ { value : "trim" , type : "Identifier" } ,
1186
+ { value : "|" , type : "Pipe" } ,
1187
+ { value : "lower" , type : "Identifier" } ,
1188
+ { value : "|" , type : "Pipe" } ,
1189
+ { value : "length" , type : "Identifier" } ,
1190
+ { value : "}}" , type : "CloseExpression" } ,
1191
+ { value : "|" , type : "Text" } ,
1192
+ ] ,
1193
+ FILTER_OPERATOR_3 : [
1194
+ { value : "|" , type : "Text" } ,
1195
+ { value : "{{" , type : "OpenExpression" } ,
1196
+ { value : "-1" , type : "NumericLiteral" } ,
1197
+ { value : "|" , type : "Pipe" } ,
1198
+ { value : "abs" , type : "Identifier" } ,
1199
+ { value : "}}" , type : "CloseExpression" } ,
1200
+ { value : "|" , type : "Text" } ,
1201
+ { value : "{{" , type : "OpenExpression" } ,
1202
+ { value : "1" , type : "NumericLiteral" } ,
1203
+ { value : "|" , type : "Pipe" } ,
1204
+ { value : "abs" , type : "Identifier" } ,
1205
+ { value : "}}" , type : "CloseExpression" } ,
1206
+ { value : "|" , type : "Text" } ,
1207
+ ] ,
1142
1208
1143
1209
// Logical operators between non-Booleans
1144
1210
BOOLEAN_NUMERICAL : [
@@ -1518,6 +1584,8 @@ const TEST_CONTEXT = {
1518
1584
FILTER_OPERATOR : {
1519
1585
arr : [ 3 , 2 , 1 ] ,
1520
1586
} ,
1587
+ FILTER_OPERATOR_2 : { } ,
1588
+ FILTER_OPERATOR_3 : { } ,
1521
1589
1522
1590
// Logical operators between non-Booleans
1523
1591
BOOLEAN_NUMERICAL : { } ,
@@ -1594,6 +1662,8 @@ const EXPECTED_OUTPUTS = {
1594
1662
1595
1663
// Filter operator
1596
1664
FILTER_OPERATOR : `3451` ,
1665
+ FILTER_OPERATOR_2 : `|3|ABCD|abcd|Test test|Test Test|a b|4|` ,
1666
+ FILTER_OPERATOR_3 : `|1|1|` ,
1597
1667
1598
1668
// Logical operators between non-Booleans
1599
1669
BOOLEAN_NUMERICAL : `|2|0|0|0|1|1|1|0|false|true|` ,
0 commit comments