@@ -68,9 +68,13 @@ func init() {
6868 desc : "Checks if this string contains another string" ,
6969 },
7070 "in" : {
71- typ : boolType , compile : compileStringIn ,
71+ typ : boolType , compile : compileStringInOrNotIn ,
7272 desc : "Checks if this string is contained in an array of strings" ,
7373 },
74+ "notIn" : {
75+ typ : boolType , compile : compileStringInOrNotIn ,
76+ desc : "Checks if this string is not contained in an array of strings" ,
77+ },
7478 "find" : {
7579 typ : stringArrayType , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .Regex }},
7680 desc : "Find a regular expression in a string and return all matches as an array" ,
@@ -126,6 +130,9 @@ func init() {
126130 "lines" : {typ : stringArrayType , signature : FunctionSignature {}},
127131 "split" : {typ : stringArrayType , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .String }}},
128132 "trim" : {typ : stringType , signature : FunctionSignature {Required : 0 , Args : []types.Type {types .String }}},
133+ // string / array
134+ "in" : {typ : boolType , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .Array (types .String ), types .Array (types .Dict )}}},
135+ "notIn" : {typ : boolType , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .Array (types .String ), types .Array (types .Dict )}}},
129136 // array- or map-ish
130137 "first" : {typ : dictType , signature : FunctionSignature {}},
131138 "last" : {typ : dictType , signature : FunctionSignature {}},
@@ -136,7 +143,6 @@ func init() {
136143 compile : compileDictContains , typ : boolType , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .FunctionLike }},
137144 desc : "When dealing with strings, check if it contains another string. When dealing with maps or arrays, check if any entry matches the given condition." ,
138145 },
139- "in" : {typ : boolType , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .Array (types .String )}}},
140146 "containsOnly" : {compile : compileDictContainsOnly , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .FunctionLike }}},
141147 "containsAll" : {compile : compileDictContainsAll , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .FunctionLike }}},
142148 "containsNone" : {compile : compileDictContainsNone , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .FunctionLike }}},
@@ -187,7 +193,8 @@ func init() {
187193 "sample" : {typHandler : & sameType , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .Int }}},
188194 "duplicates" : {compile : compileArrayDuplicates , signature : FunctionSignature {Required : 0 , Args : []types.Type {types .String }}},
189195 "unique" : {compile : compileArrayUnique , signature : FunctionSignature {Required : 0 }},
190- "in" : {typ : boolType , compile : compileStringIn , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .Array (types .String )}}},
196+ "in" : {typ : boolType , compile : compileStringInOrNotIn , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .Array (types .String )}}},
197+ "notIn" : {typ : boolType , compile : compileStringInOrNotIn , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .Array (types .String )}}},
191198 "contains" : {compile : compileArrayContains , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .FunctionLike }}},
192199 "containsOnly" : {compile : compileArrayContainsOnly , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .FunctionLike }}},
193200 "containsAll" : {compile : compileArrayContainsAll , signature : FunctionSignature {Required : 1 , Args : []types.Type {types .FunctionLike }}},
0 commit comments