Type Utils
    Preparing search index...

    Function asTypeGuard

    • Type Parameters

      • T

      Parameters

      • predicate: (value: any) => boolean

      Returns TypeGuard<T>

    • Type Parameters

      • P extends (value: any) => boolean

      Parameters

      • predicate: P

      Returns TypeGuard<Param0<P>>

    • Type Parameters

      • T

      Parameters

      • predicate: (value: any) => boolean
      • metadata: Omit<
            {
                context?: Record<string, any>
                | null;
                kind?: string;
                optional: boolean;
                rules: {
                    args: any[];
                    handler: CustomHandler<any[], T>;
                    rule: string;
                    type: "custom";
                }[];
                schema: TypeGuard<T>;
                type: "custom";
            },
            "rules"
            | OmittedKeys,
        > & Partial<
            Pick<
                {
                    context?: Record<string, any>
                    | null;
                    kind?: string;
                    optional: boolean;
                    rules: {
                        args: any[];
                        handler: CustomHandler<any[], T>;
                        rule: string;
                        type: "custom";
                    }[];
                    schema: TypeGuard<T>;
                    type: "custom";
                },
                "rules",
            >,
        >

      Returns TypeGuard<T>

    • Type Parameters

      • P extends (value: any) => boolean

      Parameters

      • predicate: P
      • metadata: Omit<
            {
                context?: Record<string, any>
                | null;
                kind?: string;
                optional: boolean;
                rules: {
                    args: any[];
                    handler: CustomHandler<any[], Param0<P>>;
                    rule: string;
                    type: "custom";
                }[];
                schema: TypeGuard<Param0<P>>;
                type: "custom";
            },
            "rules"
            | OmittedKeys,
        > & Partial<
            Pick<
                {
                    context?: Record<string, any>
                    | null;
                    kind?: string;
                    optional: boolean;
                    rules: {
                        args: any[];
                        handler: CustomHandler<any[], Param0<P>>;
                        rule: string;
                        type: "custom";
                    }[];
                    schema: TypeGuard<Param0<P>>;
                    type: "custom";
                },
                "rules",
            >,
        >

      Returns TypeGuard<Param0<P>>