isEmpty
Checks if a string is empty (""), null, or undefined.
This is a strict emptiness check — whitespace-only strings are not considered
empty. Use isEmpty(value?.trim()) if you need to treat blank strings as empty.
Available since v2.0.3
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | null | undefined | The string to check |
Returns
Section titled “Returns”value is "" | null | undefined — true if the string is "", null, or undefined
Examples
Section titled “Examples”Check if a string is empty
Section titled “Check if a string is empty”Returns true only for "". Whitespace-only strings are not considered empty.
Treat blank strings as empty by trimming first
Section titled “Treat blank strings as empty by trimming first”Compose with .trim() when whitespace-only should also be considered empty.
