@@ -25,14 +25,12 @@ public extension Expr {
2525
2626 // MARK: Arithmetic Operators
2727
28- func add( _ second : Expr , _ others : Expr ... ) -> FunctionExpr {
29- return FunctionExpr ( " add " , [ self , second ] + others )
28+ func add( _ value : Expr ) -> FunctionExpr {
29+ return FunctionExpr ( " add " , [ self , value ] )
3030 }
3131
32- func add( _ second: Sendable , _ others: Sendable ... ) -> FunctionExpr {
33- let exprs = [ self ] + [ Helper . sendableToExpr ( second) ] + others
34- . map { Helper . sendableToExpr ( $0) }
35- return FunctionExpr ( " add " , exprs)
32+ func add( _ value: Sendable ) -> FunctionExpr {
33+ return FunctionExpr ( " add " , [ self , Helper . sendableToExpr ( value) ] )
3634 }
3735
3836 func subtract( _ other: Expr ) -> FunctionExpr {
@@ -43,14 +41,12 @@ public extension Expr {
4341 return FunctionExpr ( " subtract " , [ self , Helper . sendableToExpr ( other) ] )
4442 }
4543
46- func multiply( _ second : Expr , _ others : Expr ... ) -> FunctionExpr {
47- return FunctionExpr ( " multiply " , [ self , second ] + others )
44+ func multiply( _ value : Expr ) -> FunctionExpr {
45+ return FunctionExpr ( " multiply " , [ self , value ] )
4846 }
4947
50- func multiply( _ second: Sendable , _ others: Sendable ... ) -> FunctionExpr {
51- let exprs = [ self ] + [ Helper . sendableToExpr ( second) ] + others
52- . map { Helper . sendableToExpr ( $0) }
53- return FunctionExpr ( " multiply " , exprs)
48+ func multiply( _ value: Sendable ) -> FunctionExpr {
49+ return FunctionExpr ( " multiply " , [ self , Helper . sendableToExpr ( value) ] )
5450 }
5551
5652 func divide( _ other: Expr ) -> FunctionExpr {
@@ -89,34 +85,32 @@ public extension Expr {
8985 return BooleanExpr ( " array_contains " , [ self , Helper . sendableToExpr ( element) ] )
9086 }
9187
92- func arrayContainsAll( _ values: Expr ... ) -> BooleanExpr {
93- return BooleanExpr ( " array_contains_all " , [ self ] + values)
88+ func arrayContainsAll( _ values: [ Expr ] ) -> BooleanExpr {
89+ return BooleanExpr ( " array_contains_all " , [ self , Helper . array ( values) ] )
9490 }
9591
96- func arrayContainsAll( _ values: Sendable ... ) -> BooleanExpr {
97- let exprValues = values. map { Helper . sendableToExpr ( $0) }
98- return BooleanExpr ( " array_contains_all " , [ self ] + exprValues)
92+ func arrayContainsAll( _ values: [ Sendable ] ) -> BooleanExpr {
93+ return BooleanExpr ( " array_contains_all " , [ self , Helper . array ( values) ] )
9994 }
10095
101- func arrayContainsAny( _ values: Expr ... ) -> BooleanExpr {
102- return BooleanExpr ( " array_contains_any " , [ self ] + values)
96+ func arrayContainsAny( _ values: [ Expr ] ) -> BooleanExpr {
97+ return BooleanExpr ( " array_contains_any " , [ self , Helper . array ( values) ] )
10398 }
10499
105- func arrayContainsAny( _ values: Sendable ... ) -> BooleanExpr {
106- let exprValues = values. map { Helper . sendableToExpr ( $0) }
107- return BooleanExpr ( " array_contains_any " , [ self ] + exprValues)
100+ func arrayContainsAny( _ values: [ Sendable ] ) -> BooleanExpr {
101+ return BooleanExpr ( " array_contains_any " , [ self , Helper . array ( values) ] )
108102 }
109103
110104 func arrayLength( ) -> FunctionExpr {
111105 return FunctionExpr ( " array_length " , [ self ] )
112106 }
113107
114- func arrayOffset ( _ offset: Int ) -> FunctionExpr {
115- return FunctionExpr ( " array_offset " , [ self , Helper . sendableToExpr ( offset) ] )
108+ func arrayGet ( _ offset: Int ) -> FunctionExpr {
109+ return FunctionExpr ( " array_get " , [ self , Helper . sendableToExpr ( offset) ] )
116110 }
117111
118- func arrayOffset ( _ offsetExpr: Expr ) -> FunctionExpr {
119- return FunctionExpr ( " array_offset " , [ self , offsetExpr] )
112+ func arrayGet ( _ offsetExpr: Expr ) -> FunctionExpr {
113+ return FunctionExpr ( " array_get " , [ self , offsetExpr] )
120114 }
121115
122116 func gt( _ other: Expr ) -> BooleanExpr {
@@ -172,31 +166,28 @@ public extension Expr {
172166 return BooleanExpr ( " eq " , [ self , exprOther] )
173167 }
174168
175- func neq( _ others : Expr ... ) -> BooleanExpr {
176- return BooleanExpr ( " neq " , [ self ] + others )
169+ func neq( _ other : Expr ) -> BooleanExpr {
170+ return BooleanExpr ( " neq " , [ self , other ] )
177171 }
178172
179- func neq( _ others: Sendable ... ) -> BooleanExpr {
180- let exprOthers = others. map { Helper . sendableToExpr ( $0) }
181- return BooleanExpr ( " neq " , [ self ] + exprOthers)
173+ func neq( _ other: Sendable ) -> BooleanExpr {
174+ return BooleanExpr ( " neq " , [ self , Helper . sendableToExpr ( other) ] )
182175 }
183176
184- func eqAny( _ others: Expr ... ) -> BooleanExpr {
185- return BooleanExpr ( " eq_any " , [ self ] + others)
177+ func eqAny( _ others: [ Expr ] ) -> BooleanExpr {
178+ return BooleanExpr ( " eq_any " , [ self , Helper . array ( others) ] )
186179 }
187180
188- func eqAny( _ others: Sendable ... ) -> BooleanExpr {
189- let exprOthers = others. map { Helper . sendableToExpr ( $0) }
190- return BooleanExpr ( " eq_any " , [ self ] + exprOthers)
181+ func eqAny( _ others: [ Sendable ] ) -> BooleanExpr {
182+ return BooleanExpr ( " eq_any " , [ self , Helper . array ( others) ] )
191183 }
192184
193- func notEqAny( _ others: Expr ... ) -> BooleanExpr {
194- return BooleanExpr ( " not_eq_any " , [ self ] + others)
185+ func notEqAny( _ others: [ Expr ] ) -> BooleanExpr {
186+ return BooleanExpr ( " not_eq_any " , [ self , Helper . array ( others) ] )
195187 }
196188
197- func notEqAny( _ others: Sendable ... ) -> BooleanExpr {
198- let exprOthers = others. map { Helper . sendableToExpr ( $0) }
199- return BooleanExpr ( " not_eq_any " , [ self ] + exprOthers)
189+ func notEqAny( _ others: [ Sendable ] ) -> BooleanExpr {
190+ return BooleanExpr ( " not_eq_any " , [ self , Helper . array ( others) ] )
200191 }
201192
202193 // MARK: Checks
@@ -237,12 +228,12 @@ public extension Expr {
237228 return FunctionExpr ( " char_length " , [ self ] )
238229 }
239230
240- func like( _ pattern: String ) -> FunctionExpr {
241- return FunctionExpr ( " like " , [ self , Helper . sendableToExpr ( pattern) ] )
231+ func like( _ pattern: String ) -> BooleanExpr {
232+ return BooleanExpr ( " like " , [ self , Helper . sendableToExpr ( pattern) ] )
242233 }
243234
244- func like( _ pattern: Expr ) -> FunctionExpr {
245- return FunctionExpr ( " like " , [ self , pattern] )
235+ func like( _ pattern: Expr ) -> BooleanExpr {
236+ return BooleanExpr ( " like " , [ self , pattern] )
246237 }
247238
248239 func regexContains( _ pattern: String ) -> BooleanExpr {
@@ -414,13 +405,13 @@ public extension Expr {
414405 }
415406
416407 func logicalMinimum( _ second: Expr , _ others: Expr ... ) -> FunctionExpr {
417- return FunctionExpr ( " logical_min " , [ self , second] + others)
408+ return FunctionExpr ( " logical_minimum " , [ self , second] + others)
418409 }
419410
420411 func logicalMinimum( _ second: Sendable , _ others: Sendable ... ) -> FunctionExpr {
421412 let exprs = [ self ] + [ Helper . sendableToExpr ( second) ] + others
422413 . map { Helper . sendableToExpr ( $0) }
423- return FunctionExpr ( " logical_min " , exprs)
414+ return FunctionExpr ( " logical_minimum " , exprs)
424415 }
425416
426417 // MARK: Vector Operations
0 commit comments