You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Arrays in TypeScript have a rather significant coverage defect, their index type [n: number]: T; doesn't accurately reflect a given array.
Suppose you have an empty array of type string. For any given index, every value is going to be undefined.
Some arrays are special cases (as const) which are generally safer, but on the whole an arbitrary array has a massive untyped surface.
Within this repo array types should be augmented to ensure values from arbitrary indexes are checked, outside it would be worthwhile seeing if TypeScript might change this via a new strict check.
The text was updated successfully, but these errors were encountered:
Arrays in TypeScript have a rather significant coverage defect, their index type
[n: number]: T;
doesn't accurately reflect a given array.Suppose you have an empty array of type
string
. For any given index, every value is going to beundefined
.Some arrays are special cases (
as const
) which are generally safer, but on the whole an arbitrary array has a massive untyped surface.Within this repo array types should be augmented to ensure values from arbitrary indexes are checked, outside it would be worthwhile seeing if TypeScript might change this via a new strict check.
The text was updated successfully, but these errors were encountered: