1.0.1 • Published 3 years ago
@pragmatically-typed/array.includes v1.0.1
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.