Type alias DeepGuardType<Guard>

DeepGuardType<Guard>: Guard extends ((value: infer X) => value is any) ? Guard extends ((value: X) => value is X & infer Z) ? Z : GuardType<Guard> : GuardType<Guard>

Returns a type that a Guard will assign to a variable. Deep check on parameter/value and only return type without combining value.

Example

GuardType<typeof isTypeString> // string
GuardType<typeof Array.isArray> // unknown[]

Type Parameters

  • Guard

Generated using TypeDoc