Skip to content

Function: parsePort()

parsePort(value): number | undefined

Validate a PGPORT-shaped value. Returns undefined when unset, and throws a ValidationError naming PGPORT for anything that is not a TCP port, so a typo cannot reach the connection record as NaN.

string | number | undefined

number | undefined