Skip to content

nullishEmpty

Explicitly builds an EitherLeft<"nullish"> with null or undefined.

Interactive example

Syntax

typescript
function nullishEmpty<
	const GenericInput extends NullishValue = undefined
>(
  value?: GenericInput
): EitherNullishEmpty<GenericInput>;

Parameters

  • input: null or undefined (optional).

Return value

EitherNullishEmpty<GenericInput> allowing you to explicitly signal the absence of a value.

See also

Released under the MIT license.