isguard-ts
    Preparing search index...

    Type Alias Guarded<T>

    Guarded: T extends TypeGuard<infer R> ? R : never

    Extracts the guarded type from a TypeGuard.

    Type Parameters

    • T extends AnyTypeGuard

      A TypeGuard type

    The type that the guard checks for

    type Person = {
    name: string;
    age: number
    };

    const isPerson = isType<Person>({
    name: isString,
    age: isNumber,
    });

    type PersonType = Guarded<typeof isPerson>;
    // ^? Person