nonEmptyString
function nonEmptyString(value: unknown, name: string = "value"): string;
The older form of requireNonEmptyString, kept for the code that already calls it. Its second argument is the name to put in the message rather than the message itself, which is the opposite of every other guard here — that is why it was replaced.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The value to validate. |
|
| The argument name to put in the message. |
Returns
string — the same string.
Throws
Exception | Condition |
|---|---|
| the value is not a string, or holds nothing but whitespace. |
Examples
In use
nonEmptyString("Data", "sheetName"); // => "Data"
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.