fieldHasValue function

Last updated: 2026-03-04T23:21:38.398Z

Metrics

LOC: 10 Complexity: 6 Params: 1

Signature

fieldHasValue(field: FormField): : boolean

Source Code

function fieldHasValue(field: FormField): boolean {
  const el = field.element;
  if (el instanceof HTMLInputElement) {
    if (el.type === "checkbox" || el.type === "radio") return el.checked;
    return el.value.trim() !== "";
  }
  if (el instanceof HTMLTextAreaElement) return el.value.trim() !== "";
  if (el instanceof HTMLSelectElement) return el.value !== "";
  return false;
}

No outgoing dependencies.

Impact (Incoming)

graph LR fieldHasValue["fieldHasValue"] doFillAllFields["doFillAllFields"] fillContextualAI["fillContextualAI"] doFillAllFields -->|calls| fieldHasValue fillContextualAI -->|calls| fieldHasValue style fieldHasValue fill:#dbeafe,stroke:#2563eb,stroke-width:2px click fieldHasValue "5a7659a4d189d652.html" click doFillAllFields "23fe5c1a0125e335.html" click fillContextualAI "854e1a4562eb49e4.html"
SourceType
doFillAllFields calls
fillContextualAI calls