News for hackers. Stuff that matters.
Re:TIL: `satisfies` is my favorite TypeScript keyword by ameliaquining on Saturday November 22, 2025 @08:35PM (#46019947)
First one flattens a potentially-nested tuple type. E.g., FlatArr<[number, [boolean, string]]> is [number, boolean, string].

Second one gets the element type of a potentially-nested array type. E.g., Flatten<number[][]> is number.

For what it's worth, I've never needed to use either of these, though I've occasionally had other uses for slightly fancy TypeScript type magic.

There are no comments on this comment yet.