config/test.ts
2025-07-15 14:06:48 -07:00

20 lines
595 B
TypeScript

const option = collectionDetails
.fields
.find(
(field): field is { type: "Option", slug: string, validations: WebflowValidations["Option"] } =>
field.slug === fieldData.path
)!
.validations;
if (fieldData.type
"Option" && typeof rawValue
"string")
return (
(
collectionDetails.fields. find (predicate: (field) field.slug
| WebflowValidations["Option"]
| undefined
fieldData.path) ?. validations as
)?. options.find(predicate: (option) option.id
rawValue) ?. name ?? fullMatch
);