Kaizen
Browse modulesFormsforms/sharedFunctions

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 next section-header or 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

ParameterType
fieldsFormFieldDefinition[]

Returns

FormFieldDefinition[]

On this page