piotrwitek / utility-types

Collection of utility types, complementing TypeScript built-in mapped types and aliases (think "lodash" for static types).
MIT License
5.54k stars 230 forks source link

Add NonEmptyArray #199

Open davidtjones02 opened 4 months ago

davidtjones02 commented 4 months ago

Description

Added NonEmptyArray to type utilities. Existed as an outstanding issue for a while that from what I can tell hasn't had a PR yet. Useful for ensuring your arrays are not empty if the expectation is to provide at least one item of a varying type.

Please let me know if any additional work is needed, hoping I've added where necessary!

Cheers.

Related issues:

Checklist

For bugfixes:

For new features: