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

Function invertRuntimePredicate

src/api/TaskNotesAPI.ts:3262–3274  ·  view source on GitHub ↗
(
	predicate: TaskNotesRuntimeNormalizedPredicate
)

Source from the content-addressed store, hash-verified

3260}
3261
3262function invertRuntimePredicate(
3263 predicate: TaskNotesRuntimeNormalizedPredicate
3264): TaskNotesRuntimeNormalizedPredicate | null {
3265 if ("all" in predicate) {
3266 return { any: predicate.all.map(invertRuntimePredicate).filter(isDefined) };
3267 }
3268 if ("any" in predicate) {
3269 return { all: predicate.any.map(invertRuntimePredicate).filter(isDefined) };
3270 }
3271 if ("not" in predicate) return predicate.not;
3272 const invertedOperator = invertRuntimeOperator(predicate.op);
3273 return invertedOperator ? { ...predicate, op: invertedOperator } : null;
3274}
3275
3276function invertRuntimeOperator(
3277 operator: TaskNotesRuntimeOperator

Callers 1

Calls 1

invertRuntimeOperatorFunction · 0.85

Tested by

no test coverage detected