Files
twenty/packages
Claude 305cec6996 Replace unsafe as casts with Zod-based isField*Value guards
Replace manual type assertions (as FieldXValue) with proper Zod
validation guards across 6 frontend files:

- useGetSecondaryRecordTableCellButton: validate phones/emails/links
  values before accessing properties
- EventFieldDiffValueEffect: use isFieldFilesValue instead of
  Array.isArray + as cast
- CurrencyFieldInput: validate defaultValue with isFieldCurrencyValue
- FilesFieldInput: validate draftValue with isFieldFilesValue
- useOpenFilesFieldInput: validate store value with isFieldFilesValue
- FormFieldInput: validate all composite field defaults (fullName,
  address, links, emails, phones, richText) with their respective
  Zod guards

Also removes the not-yet-merged getPrimaryEmailFromRecord utility.

https://claude.ai/code/session_01K2CBC59gYw93d8YVQm3mXX
2026-04-09 20:36:11 +00:00
..