( sql: SQLStatementType, sqlArray: $ReadOnlyArray<SQLStatementType>, delimeter: SQLOrString, )
| 61 | } |
| 62 | |
| 63 | function appendSQLArray( |
| 64 | sql: SQLStatementType, |
| 65 | sqlArray: $ReadOnlyArray<SQLStatementType>, |
| 66 | delimeter: SQLOrString, |
| 67 | ): SQLStatementType { |
| 68 | if (sqlArray.length === 0) { |
| 69 | return sql; |
| 70 | } |
| 71 | const [first, ...rest] = sqlArray; |
| 72 | sql.append(first); |
| 73 | if (rest.length === 0) { |
| 74 | return sql; |
| 75 | } |
| 76 | return rest.reduce( |
| 77 | (prev: SQLStatementType, curr: SQLStatementType) => |
| 78 | prev.append(delimeter).append(curr), |
| 79 | sql, |
| 80 | ); |
| 81 | } |
| 82 | |
| 83 | function mergeConditions( |
| 84 | conditions: $ReadOnlyArray<SQLStatementType>, |
no outgoing calls
no test coverage detected