by explicitly marking a truthy value.">
Skip to content

boolTruthy ​

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

Interactive example ​

Syntax ​

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

Parameters ​

  • input: Value considered truthy.

Return value ​

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

See also ​

Released under the MIT license.