@buzzr/dfs-engine
    Preparing search index...

    Function gradeLegFromActual

    • Pure leg grader. Caller resolves the actual stat via extractStatForProp.

      When to use this vs the Explained variant:

      • gradeLegFromActual (this fn) — returns 'won' | 'lost' | 'push' | 'pending'. Use when you just want the status.

      • gradeLegFromActualExplained — returns a discriminated union with 'unparseable_actual' as a separate state from 'pending'. Use when surfacing a "data error" UI distinct from "still settling".

      • line === actual is treated as PUSH (DFS slips use x.5 lines almost exclusively, so equality means OCR misread or the user typed an integer line manually).

      • actual === null or non-finite (NaN/Infinity) returns 'pending'.

      v0.2 bug fix: prior versions would grade NaN/Infinity as 'lost' because the NaN comparison fell through to actual > line which is always false. Callers that relied on the broken behavior should switch to gradeLegFromActualExplained for the new 'unparseable_actual' reason.

      Parameters

      • line: number
      • direction: "over" | "under"
      • actual: number | null

      Returns DfsLegStatus