DAFT - v1.0.0
    Preparing search index...

    Interface Predicate

    A predicate function that determines when a step should stop iterating.

    The predicate is evaluated after each iteration with the current data. Returns an object with ok (success) and optional msg (failure reason).

    const analyzeDone: Predicate = (data) => {
    const hasAnalysis = data && typeof data === 'object' && 'analysis' in data;
    return {
    ok: hasAnalysis,
    msg: hasAnalysis ? undefined : 'No analysis found'
    };
    };
    • Evaluate the predicate with the current data.

      Parameters

      • data: unknown

        The current data state

      Returns { ok: boolean; msg?: string }

      Object with ok (true if predicate satisfied) and optional msg (why not satisfied)