devtypes - v2.0.0
    Preparing search index...

    Type Alias AssertArray<T>

    AssertArray: T

    Assert that a type is an array or readonly array.

    Type Parameters

    • T extends readonly any[]

      Type that must be an array

    Ensures that the given type is assignable to a tuple or array type. Fails at compile time for non-array types.

    type A = AssertArray< number[] >;           // ✓
    type B = AssertArray< readonly string[] >; // ✓
    type C = AssertArray< string >; // ✗ TS error