isguard-ts
    Preparing search index...

    Type Alias LiteralTypeGuard<T>

    LiteralTypeGuard: TypeGuard<T[number]> & {
        values: T;
        exclude<V extends readonly T[number][]>(
            ...values: V,
        ): LiteralTypeGuard<Exclude<T[number], V[number]>[]>;
        extract<V extends readonly T[number][]>(...values: V): LiteralTypeGuard<V>;
    }

    A TypeGuard for literal values.

    Returned by isLiteral.

    Type Parameters

    • T extends readonly Literal[]

      Array of literal values to guard

    Type Declaration

    • values: T

      The array of literal values this guard accepts

    • exclude: function
      • Creates a new guard that accepts all values except the specified ones

        Type Parameters

        • V extends readonly T[number][]

        Parameters

        • ...values: V

        Returns LiteralTypeGuard<Exclude<T[number], V[number]>[]>

    • extract: function