Skip to content

isOptionalFilled ​

Type guard that checks that an optional contains a value.

Interactive example ​

Syntax ​

typescript
function isOptionalFilled<
	GenericInput extends unknown
>(
  input: GenericInput
): input is Extract<GenericInput, OptionalFilled>;

Parameters ​

  • input: Result of optional.

Return value ​

true if the value is defined.

See also ​

Released under the MIT license.