Function guardAllIn

  • Given one or multiple Type Guards as array, 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 = guardAllIn([
    matchSchema({ foo: match'foo') }),
    matchSchema({ bar: match'bar') })
    ]); // val is { readonly foo: "foo"; } & { readonly bar: "bar"; }

    Type Parameters

    Parameters

    • guards: readonly [Readonly<Guards>]

    Returns GuardAllInFn<Guards>

Generated using TypeDoc