TypeScript Stories
59 subscribers
40 links
Download Telegram
Channel created
1️⃣
string + string | number => string
number + string | number => error 2365

▶️ Playground
2️⃣
No error firing on generic wrong return type.

▶️ Playground
3️⃣
Type guard wrong types intersection via casting to unknown.

▶️ Playground
4️⃣
🤔 Guarded type narrowing.

▶️ Playground
5️⃣
🧐 A bit more complex guarded type.

▶️ Playground
6️⃣
Inaccurate "1/1" | "2/2" type inference.

▶️ Playground
7️⃣
No errors when mutating tuples by number index.

▶️ Playground
8️⃣
Interface doesn't fit Record<string, unknown>.

▶️ Playground
9️⃣
🤯 Type any passes extends operator along both branches.

▶️ Playground
🔟
Brand as key of Record might be type unsafe.
▶️ Playground

🤨 But Flavour as key of Record is just OK.
▶️ Playground