buildClassifiersFromSettings function presentation exported ✓ 100.0%
Last updated: 2026-03-04T23:21:38.391Z
Metrics
LOC: 14
Complexity: 3
Params: 2
Coverage: 100.0% (6/6 lines, 7x executed)
Signature
buildClassifiersFromSettings(
config: Array<{ name: string; enabled: boolean }>,
): : FieldClassifier[]
Summary
Builds a classifier list from a user-defined ordered config. Strategies not listed or disabled are excluded. html-fallback is always appended last when not already present.
Source Code
export function buildClassifiersFromSettings(
config: Array<{ name: string; enabled: boolean }>,
): FieldClassifier[] {
const ordered = config
.filter((s) => s.enabled && NAMED_CLASSIFIERS[s.name])
.map((s) => NAMED_CLASSIFIERS[s.name]);
// Ensure there's always a fallback terminator
if (!ordered.find((c) => c.name === "html-fallback")) {
ordered.push(htmlFallbackClassifier);
}
return ordered;
}
No outgoing dependencies.
Impact (Incoming)
| Source | Type |
|---|---|
| FillableElement | uses |
| classifierNames | uses |