detect method ✓ 100.0%

Last updated: 2026-03-02T15:32:34.984Z

Metrics

LOC: 14 Complexity: 5 Params: 1 Coverage: 100.0% (7/7 lines, 33x executed)

Signature

detect(field: FormField): : ClassifierResult | null

Source Code

  detect(field: FormField): ClassifierResult | null {
    const raw = field.contextSignals ?? "";
    if (!raw.trim()) return null;

    const normalized = normalize(raw);

    for (const rule of KEYWORD_RULES) {
      if (matchesRule(normalized, rule)) {
        return { type: rule.type, confidence: 1.0 };
      }
    }

    return null;
  },

Dependencies (Outgoing)

graph LR detect["detect"] normalize["normalize"] matchesRule["matchesRule"] detect -->|calls| normalize detect -->|calls| matchesRule style detect fill:#dbeafe,stroke:#2563eb,stroke-width:2px click detect "3ad5e2f09986771f.html" click normalize "87c87498f93bf3ff.html" click matchesRule "1a959a10048b5e94.html"
TargetType
normalize calls
matchesRule calls

No incoming dependencies.