( value: TaskNotesRuntimeValue | undefined )
| 3201 | } |
| 3202 | |
| 3203 | function toFilterConditionValue( |
| 3204 | value: TaskNotesRuntimeValue | undefined |
| 3205 | ): FilterCondition["value"] { |
| 3206 | if (typeof value === "undefined") return null; |
| 3207 | if (Array.isArray(value)) { |
| 3208 | return value.map((entry) => String(toFilterConditionValue(entry))); |
| 3209 | } |
| 3210 | if (isRecord(value)) { |
| 3211 | if (value["fn"] === "today") return "today"; |
| 3212 | if (value["fn"] === "now") return new Date().toISOString(); |
| 3213 | if (value["fn"] === "date" && typeof value["value"] === "string") return value["value"]; |
| 3214 | if (value["fn"] === "dateAdd") return dateAddRuntimeValue(value); |
| 3215 | } |
| 3216 | if ( |
| 3217 | typeof value === "string" || |
| 3218 | typeof value === "number" || |
| 3219 | typeof value === "boolean" || |
| 3220 | value === null |
| 3221 | ) { |
| 3222 | return value; |
| 3223 | } |
| 3224 | return stringifyUnknownValue(value); |
| 3225 | } |
| 3226 | |
| 3227 | function stringifyUnknownValue(value: unknown): string { |
| 3228 | if ( |
no test coverage detected