TypeScript Ternary Overload
ESLint: ⚠️ "Nesting ternary expressions can make code more difficult to understand." TypeScript: type ExtractRouteParams<T extends string> = string extends T ? Record<string, string> : T extends `${infer Start}:${infer Param}/${infer Rest}` ? {[k in Param | keyof ExtractRouteParams<Rest>]: string} : T extends `${infer Start}:${infer Param}` ? {[k in Param]: string} : {};
The meme contrasts ESLint warning against nested ternary expressions with TypeScript code that uses several deeply nested conditional types. The many-armed person represents TypeScript enthusiastically ignoring the warning while writing increasingly complex type logic. It is used as a reaction to clever, overcomplicated, or excessively type-heavy code.
man / мужчинаmultiple arms / множество рукbrown T-shirt / коричневая футболкаpeople in the background / люди на заднем планеraised middle fingers / поднятые средние пальцыcars / автомобилиnight scene / ночная сценаcomputer code / программный кодcode block / блок кодаwarning emoji / эмодзи предупреждения
- @profunctor_io / 8557 2023-01-03
- @dev_meme / 5103 2023-01-30
- @right_wing_dev_squads / 11307 2025-01-14
- @profunctor_io / 10625 2025-01-17
- Type
- image
- Size
- 593×800 · 75.7 KiB
- Mood
- саркастичный
- Language
- en
- Added