koval-ui
Version:
React components collection with minimalistic design. Supports theming, layout, and input validation.
1 lines • 767 B
Source Map (JSON)
{"version":3,"file":"getFormState.cjs","sources":["../../../../src/internal/inputs/getFormState.ts"],"sourcesContent":["export type FormState = Record<string, FormDataEntryValue>;\n\nexport const getFormState = (formElement: HTMLFormElement | null) => {\n const data = formElement && new FormData(formElement);\n const formState: FormState = {};\n if (data) {\n for (const [key, value] of data.entries()) {\n formState[key] = value;\n }\n }\n return formState;\n};\n"],"names":["getFormState","formElement","data","formState","key","value"],"mappings":"6FAEa,MAAAA,EAAgBC,GAAwC,CACjE,MAAMC,EAAOD,GAAe,IAAI,SAASA,CAAW,EAC9CE,EAAuB,CAAC,EAC9B,GAAID,EACA,SAAW,CAACE,EAAKC,CAAK,IAAKH,EAAK,UAC5BC,EAAUC,CAAG,EAAIC,EAGlB,OAAAF,CACX"}