Skip to content

Function: firstNonEmpty()

firstNonEmpty(value): string | null

Trim the first usable string out of value. Returns null when value is undefined, null, an empty string, or an array whose first string member is empty. Mirrors how Express / Node header accessors expose single vs. repeated headers - the first non-empty entry wins, everything else is ignored.

unknown

string | null