Function negateGuard

  • Negates the output of any given Type Guard and types accordingly using Exclude.

    Example

    import { negateGuard, isNull } from 'type-guard-helpers'
    const test = 'a' as string | null;
    if (negateGuard(isNull, test)) {
    test; // string
    }

    Type Parameters

    Parameters

    • guard: Guard

    Returns NegateTypeGuardFn<GuardType<Guard>>

Generated using TypeDoc