@pragmatically-typed/array.includes
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Using includes on a const array is a pain. This patch allows a broader type to be passed to includes and uses a type predicate to narrow the type. A common example is using a const array to represent valid states. Often we'll want to check if a generic string coming from user input is a valid state, this patch allows us to use .includes for that.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.17latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.17
1.0.00

Package Sidebar

Install

npm i @pragmatically-typed/array.includes

Weekly Downloads

7

Version

1.0.1

License

MIT

Unpacked Size

1.42 kB

Total Files

3

Last publish

Collaborators

  • jfleckenstein