@meld-ts/core
    Preparing search index...

    Type Alias InferGuard<G>

    InferGuard: G extends TypeGuard<infer T> ? T : never

    从 TypeGuard 提取被守卫的类型

    条件类型:若 GTypeGuard<T>,则提取 T;否则为 never。 对联合类型自动分布,得到各分支的联合——这正是 or() 返回类型所需。

    Type Parameters

    • G
    type T = InferGuard<typeof isString>;  // string
    type U = InferGuard<typeof isString | typeof isNumber>; // string | number