Validation Functions
isNil
Checks if a value isnull or undefined.
The value to check
true if the value is null or undefined, otherwise falseisUrl
Checks if a string is a valid URL.The string to validate
true if the string is a valid URL starting with http, otherwise falseisImg
Checks if a path points to an image file based on extension.The file path to check
true if the path ends with an image extension (png, jpg, jpeg, svg, webp, gif, bmp)isBrowser
Checks if the code is running in a browser environment.true if running in a browser environment with window, document, and matchMedia availableisDeepEqualReact
Performs deep equality comparison of two values, with React-specific optimizations.First value to compare
Second value to compare
Keys to ignore during comparison
true if values are deeply equal, including support for Arrays, Maps, Sets, RegExp, and React elementsObject Manipulation
omitBoolean
Filters out booleantrue values from a union type.
The value to filter
Returns the value if it’s not a boolean or is
false, otherwise undefinedomitUndefined
Removes properties withundefined values from an object.
The object to clean
A new object with all
undefined properties removed. Returns undefined if the result is empty.omitUndefinedAndEmptyArr
Removes properties withundefined values or empty arrays from an object.
The object to clean
A new object with
undefined values and empty arrays removedmerge
Merges multiple objects into one, with deep merging for nested objects.Objects to merge (later objects override earlier ones)
A new merged object. Nested objects are merged recursively, arrays and other values are replaced.
pickProProps
Filters out ProComponents-specific props from a props object.The props object to filter
If
true, includes valueType and other Pro props in the resultA new object with ProComponents-specific props removed
pickProFormItemProps
Extracts only Ant Design Form.Item props from a props object.The props object to filter
An object containing only valid Ant Design Form.Item props
Data Transformation
transformKeySubmitValue
Transforms object keys and values before form submission.The object to transform
Mapping of keys to transformation functionsSupports two formats:
- Dot notation:
'user.name'for nested paths - Nested objects:
{ user: { name: transformFn } }
The transformed object. Transformation functions can return:
- A primitive value to replace the original value
- An object to merge into the parent object (removes original key)
stringify
Safely stringifies objects with circular references and BigInt support.The value to stringify
JSON string with support for:
- Circular references (replaced with
'Magic circle!') - BigInt values
- Maximum depth of 4 levels
ID Generation
nanoid
Generates a unique ID using crypto.randomUUID or a fallback.A unique identifier string. Uses
crypto.randomUUID() if available, otherwise generates a custom nano ID.Function Utilities
runFunction
Executes a value if it’s a function, otherwise returns the value.A value or function to execute
Arguments to pass to the function if
valueEnum is a functionThe result of calling the function (if it’s a function), or the value itself
Record Key Utilities
recordKeyToString
Converts a record key (which can be a single key or array of keys) to a string.A single key or array of keys
String representation of the key. Arrays are joined with commas.
editableRowByKey
Updates, adds, or deletes a row in a data array by key, supporting nested children.Configuration object
Array of records
Function to get row key
Key of the row to modify
Row data
Name of the children property
Action to perform:
'update': Update existing row or add at bottom'top': Add new row at top'delete': Remove the row
Updated array with the modification applied