Pacote
    Preparing search index...

    Module @pacote/non-empty-array

    @pacote/non-empty-array

    version minified minified + gzip

    An array type guaranteed to have at least one element.

    The module consumes and returns plain JavaScript arrays, but is typed to prevent the TypeScript compiler from handling arrays that might be empty.

    One instance where non-empty arrays are useful is when combined with @pacote/result to create a Validation data type that accumulates multiple errors as Result<T, NonEmptyArray<Error>>. This is because a failing computation must have at least one error.

    yarn add @pacote/non-empty-array
    

    MIT © Luís Rodrigues.

    Type Aliases

    NonEmptyArray

    Functions

    concat
    fromArray
    fromElements
    isNonEmptyArray