Form Helpers
Starting from version 2, a new module named form-helpers
has been introduced in this package. This module provides internal utility functions to manipulate field values, saving both time and effort for developers.
The list internal functions exported from this module are:
📄️ fieldNameToLabel
Definition and usage of a function to generate user-friendly label from a string in camelCase or snake_case.
📄️ colorToString
Function to convert a color object in RGB or HSV format into a valid CSS color string.
📄️ getFileSize
Returns the size of a file to the nearest bytes, KB, MB or GB.
📄️ validateFileList
Validates a list of files based on size limit and extension to return an array of acceptedFiles, rejectedFiles and errors.