Day 17. We can strongly-type the composition and utilities using generics.
To avoid type narrowing for string utilities, we can recast it using string utility types.
To avoid type narrowing for string utilities, we can recast it using string utility types.
Comments
The trick is to assert whether the generic is provided or not. If it's not provided, access the array element. Otherwise, return the generic as-is.
We can check if an element exist in an array using `extends`