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)
| Target | Type |
|---|---|
| normalize | calls |
| matchesRule | calls |
No incoming dependencies.