0.3.2 • Published 9 months ago

@pacote/non-empty-array v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@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.

Installation

yarn add @pacote/non-empty-array

License

MIT © Luís Rodrigues.

0.3.2

9 months ago

0.3.0

1 year ago

0.3.1

1 year ago

0.2.4

1 year ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago