Skip to content

Commit 04bca9e

Browse files
committed
Fix documentation
1 parent 574e44e commit 04bca9e

File tree

2 files changed

+333
-297
lines changed

2 files changed

+333
-297
lines changed

Firestore/Swift/Source/ExprImpl.swift

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,12 @@ public extension Expression {
6767

6868
// MARK: Array Operations
6969

70-
func arrayConcat(_ secondArray: Expression, _ otherArrays: Expression...) -> FunctionExpression {
71-
return FunctionExpression("array_concat", [self, secondArray] + otherArrays)
70+
func arrayConcat(_ arrays: [Expression]) -> FunctionExpression {
71+
return FunctionExpression("array_concat", [self] + arrays)
7272
}
7373

74-
func arrayConcat(_ secondArray: [Sendable], _ otherArrays: [Sendable]...) -> FunctionExpression {
75-
let exprs = [self] + [Helper.sendableToExpr(secondArray)] + otherArrays
76-
.map { Helper.sendableToExpr($0) }
74+
func arrayConcat(_ arrays: [[Sendable]]) -> FunctionExpression {
75+
let exprs = [self] + arrays.map { Helper.sendableToExpr($0) }
7776
return FunctionExpression("array_concat", exprs)
7877
}
7978

@@ -198,7 +197,7 @@ public extension Expression {
198197
return BooleanExpr("is_nan", [self])
199198
}
200199

201-
func isNull() -> BooleanExpr {
200+
func isNil() -> BooleanExpr {
202201
return BooleanExpr("is_null", [self])
203202
}
204203

@@ -214,7 +213,7 @@ public extension Expression {
214213
return BooleanExpr("is_absent", [self])
215214
}
216215

217-
func isNotNull() -> BooleanExpr {
216+
func isNotNil() -> BooleanExpr {
218217
return BooleanExpr("is_not_null", [self])
219218
}
220219

@@ -288,13 +287,12 @@ public extension Expression {
288287
return FunctionExpression("trim", [self])
289288
}
290289

291-
func strConcat(_ secondString: Expression, _ otherStrings: Expression...) -> FunctionExpression {
292-
return FunctionExpression("str_concat", [self, secondString] + otherStrings)
290+
func strConcat(_ strings: [Expression]) -> FunctionExpression {
291+
return FunctionExpression("str_concat", [self] + strings)
293292
}
294293

295-
func strConcat(_ secondString: String, _ otherStrings: String...) -> FunctionExpression {
296-
let exprs = [self] + [Helper.sendableToExpr(secondString)] + otherStrings
297-
.map { Helper.sendableToExpr($0) }
294+
func strConcat(_ strings: [String]) -> FunctionExpression {
295+
let exprs = [self] + strings.map { Helper.sendableToExpr($0) }
298296
return FunctionExpression("str_concat", exprs)
299297
}
300298

@@ -359,15 +357,13 @@ public extension Expression {
359357
return FunctionExpression("map_remove", [self, keyExpr])
360358
}
361359

362-
func mapMerge(_ secondMap: [String: Sendable],
363-
_ otherMaps: [String: Sendable]...) -> FunctionExpression {
364-
let secondMapExpr = Helper.sendableToExpr(secondMap)
365-
let otherMapExprs = otherMaps.map { Helper.sendableToExpr($0) }
366-
return FunctionExpression("map_merge", [self, secondMapExpr] + otherMapExprs)
360+
func mapMerge(_ maps: [[String: Sendable]]) -> FunctionExpression {
361+
let mapExprs = maps.map { Helper.sendableToExpr($0) }
362+
return FunctionExpression("map_merge", [self] + mapExprs)
367363
}
368364

369-
func mapMerge(_ secondMap: Expression, _ otherMaps: Expression...) -> FunctionExpression {
370-
return FunctionExpression("map_merge", [self, secondMap] + otherMaps)
365+
func mapMerge(_ maps: [Expression]) -> FunctionExpression {
366+
return FunctionExpression("map_merge", [self] + maps)
371367
}
372368

373369
// --- Added Aggregate Operations (on Expr) ---
@@ -394,23 +390,21 @@ public extension Expression {
394390

395391
// MARK: Logical min/max
396392

397-
func logicalMaximum(_ second: Expression, _ others: Expression...) -> FunctionExpression {
398-
return FunctionExpression("logical_maximum", [self, second] + others)
393+
func logicalMaximum(_ expressions: [Expression]) -> FunctionExpression {
394+
return FunctionExpression("logical_maximum", [self] + expressions)
399395
}
400396

401-
func logicalMaximum(_ second: Sendable, _ others: Sendable...) -> FunctionExpression {
402-
let exprs = [self] + [Helper.sendableToExpr(second)] + others
403-
.map { Helper.sendableToExpr($0) }
397+
func logicalMaximum(_ values: [Sendable]) -> FunctionExpression {
398+
let exprs = [self] + values.map { Helper.sendableToExpr($0) }
404399
return FunctionExpression("logical_maximum", exprs)
405400
}
406401

407-
func logicalMinimum(_ second: Expression, _ others: Expression...) -> FunctionExpression {
408-
return FunctionExpression("logical_minimum", [self, second] + others)
402+
func logicalMinimum(_ expressions: [Expression]) -> FunctionExpression {
403+
return FunctionExpression("logical_minimum", [self] + expressions)
409404
}
410405

411-
func logicalMinimum(_ second: Sendable, _ others: Sendable...) -> FunctionExpression {
412-
let exprs = [self] + [Helper.sendableToExpr(second)] + others
413-
.map { Helper.sendableToExpr($0) }
406+
func logicalMinimum(_ values: [Sendable]) -> FunctionExpression {
407+
let exprs = [self] + values.map { Helper.sendableToExpr($0) }
414408
return FunctionExpression("logical_minimum", exprs)
415409
}
416410

0 commit comments

Comments
 (0)