TypeScript Stories
@typescripts
60
subscribers
40
links
Download Telegram
Join
TypeScript Stories
60 subscribers
TypeScript Stories
3️⃣
0️⃣
❌
Assign non-nullable type
{}
to non-primitive
object
.
▶️
Playground
TypeScript Stories
3️⃣
1️⃣
❌
Incrementing literal type in
for
loop.
▶️
Playground
TypeScript Stories
3️⃣
2️⃣
❌
Wrong type inference with
Capitalize
and
Uncapitalize
utility types.
▶️
Playground
TypeScript Stories
3️⃣
3️⃣
❌
Something wrong with type inference or
Promise.then
typings.
▶️
Playground
✅
Solution
TypeScript Stories
3️⃣
4️⃣
❌
Weird incorrect autocompletion.
▶️
Playground
TypeScript Stories
3️⃣
5️⃣
❌
Partial type spreading error.
▶️
Playground
✅
Solution
TypeScript Stories
3️⃣
6️⃣
❌
Wrong type inference for
number
comparing to literals.
▶️
Playground
TypeScript Stories
3️⃣
7️⃣
❌
Wrong union assignment.
▶️
Playground
TypeScript Stories
3️⃣
8️⃣
❌
Type guard narrowing type loss after reassignment.
▶️
Playground
TypeScript Stories
3️⃣
9️⃣
❌
Dangerous usage of spread operator.
▶️
Playground
TypeScript Stories
4️⃣
0️⃣
❌
Incorrect type narrowing for
let value: <union type> = ...
▶️
Playground
▶️
More real-world example and solution