import type {FieldReturn, FieldProps} from '../../types' import {merge} from '../../configStore' /** * Apply `FieldProps` to fields. * This function merges the provided `FieldProps` into each field in the array. * * @param props - `FieldProps` to apply to fields. * @param fields - Array of fields to apply props to. * @returns A new array of fields with merged properties. */ export const apply = (props: Partial, fields: FieldReturn[]): FieldReturn[] => fields.map((field) => merge(field as any, props) as FieldReturn)