Function: scrubDeprecatedFields()
function scrubDeprecatedFields(fields: FormFieldDefinition[]): FormFieldDefinition[];Defined in: shared/forms/scrub-deprecated-fields.ts:24
Filters deprecated field types out of a parsed builder field list before a builder UI ingests them as state. The Zod schema on import("./schemas").formSchemaContentSchema intentionally remains tolerant of these types so historical FormSchemaVersion rows still validate; this helper exists so a builder UI never has to surface or reason about them.
Currently scrubs:
section-unset: the legacy "End Section" terminator. Modern builders terminate sections implicitly at the nextsection-headeror end of the form, so the marker is no longer meaningful in builder state.
Does not traverse into field-array sub-fields — the deprecated types
are top-level-only by construction.
Parameters
| Parameter | Type |
|---|---|
fields | FormFieldDefinition[] |