normalize function ✓ 100.0%
Last updated: 2026-03-02T15:32:34.984Z
Metrics
LOC: 9
Complexity: 1
Params: 1
Coverage: 100.0% (1/1 lines, 31x executed)
Signature
normalize(text: string): : string
Summary
Normalises a signals string for keyword matching: - lowercases - strips diacritics (ã → a, é → e, etc.) - replaces common separators (*, -, _, ., /) with spaces - collapses runs of whitespace
Source Code
function normalize(text: string): string {
return text
.toLowerCase()
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "")
.replace(/[*\-_./\\|]/g, " ")
.replace(/\s+/g, " ")
.trim();
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| FormField | uses |
| FieldType | uses |
| FieldClassifier | uses |
| ClassifierResult | uses |
Impact (Incoming)
| Source | Type |
|---|---|
| detect | calls |