ts-type-forge
    Preparing search index...

    Type Alias MutableNonEmptyArray<A>

    MutableNonEmptyArray: [A, ...A[]]

    Represents a mutable array that is guaranteed to have at least one element.

    Type Parameters

    • A

      The type of elements in the array.

    type NA = MutableNonEmptyArray<string>; // [string, ...string[]]
    const valid: NA = ["hello"];
    const alsoValid: NA = ["hello", "world"];
    // const invalid: NA = []; // Error