MCPcopy Create free account
hub / github.com/CommE2E/comm / appendSQLArray

Function appendSQLArray

keyserver/src/database/database.js:63–81  ·  view source on GitHub ↗
(
  sql: SQLStatementType,
  sqlArray: $ReadOnlyArray<SQLStatementType>,
  delimeter: SQLOrString,
)

Source from the content-addressed store, hash-verified

61}
62
63function 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
83function mergeConditions(
84 conditions: $ReadOnlyArray<SQLStatementType>,

Callers 2

postMessageSendFunction · 0.90
mergeConditionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected