Function guardAll

  • Given one or multiple Type Guards as parameters, returns a Type Guard that checks if the given value matches all given Type Guards.

    Example

    import { guardPipe In,  match, matchSchema } from 'type-guard-helpers';
    const isFooBar = guardAll(
    matchSchema({ foo: match'foo') }),
    matchSchema({ bar: match'bar') })
    ); // val is { readonly foo: "foo"; } & { readonly bar: "bar"; }

    Type Parameters

    Parameters

    • Rest ...guards: readonly [Readonly<Guards>]

    Returns GuardAllInFn<Guards>

Generated using TypeDoc