MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / toFilterConditionValue

Function toFilterConditionValue

src/api/TaskNotesAPI.ts:3203–3225  ·  view source on GitHub ↗
(
	value: TaskNotesRuntimeValue | undefined
)

Source from the content-addressed store, hash-verified

3201}
3202
3203function 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
3227function stringifyUnknownValue(value: unknown): string {
3228 if (

Callers 2

dateAddRuntimeValueFunction · 0.85

Calls 3

dateAddRuntimeValueFunction · 0.85
stringifyUnknownValueFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected