Skip to content

boolTruthy

Forces the creation of an EitherRight<"bool"> by explicitly marking a truthy value.

Interactive example

Syntax

typescript
function boolTruthy<
	const GenericInput extends unknown
>(
  input: GenericInput
): EitherBoolTruthy<GenericInput>;

Parameters

  • input: Value considered truthy.

Return value

An EitherRight<"bool", GenericInput> guaranteeing that the Right branch represents the truthy case.

See also

Released under the MIT license.