applyValueToField function
Last updated: 2026-03-04T23:21:38.398Z
Location
Metrics
LOC: 27
Complexity: 7
Params: 3
Signature
applyValueToField(
field: FormField,
value: string,
): : Promise<void>
Source Code
async function applyValueToField(
field: FormField,
value: string,
): Promise<void> {
// Delegate to custom adapter if the field was detected by one
if (field.adapterName) {
const handled = await fillCustomComponent(field, value);
if (handled) return;
}
const el = field.element;
if (el instanceof HTMLSelectElement) {
handleSelectElement(el, value);
return;
}
if (
el instanceof HTMLInputElement &&
(el.type === "checkbox" || el.type === "radio")
) {
handleCheckboxOrRadio(el);
return;
}
setNativeValue(el, value);
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| fillCustomComponent | calls |
| handleSelectElement | calls |
| handleCheckboxOrRadio | calls |
| setNativeValue | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| doFillAllFields | calls |
| fillSingleField | calls |
| fillContextualAI | calls |
| applyTemplate | calls |