apps-script-utils 2.1.1 Help

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

value

unknown

The value to validate.

name (optional) = "value"

string

The argument name to put in the message. "value" by default.

Returns

string — the same string.

Throws

Exception

Condition

InvalidStringException

the value is not a string, or holds nothing but whitespace.

Examples

In use

nonEmptyString("Data", "sheetName"); // => "Data"

See also

Source

src/lang/string/nonEmptyString.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.