2 ms·
(removed)
by dvt 1y ago
(removed)
- kuruczgy 1y agoTypeScript (the types part) absolutely does have ternary operators: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html https://www.typescriptlang.org/docs/handbook/2/conditional-t...
- mpoteat 1y agoI took a look at the source for the attached repository - the parser is in fact clearly written as a generic type. The presence of ?, :, and ... operators represent conditional types and tuple level destructuring respectively. This is a very impressive project in my view - it's baffling that you would have the wherewithal to link the discussion you did but not realize the novelty here.
- aprilthird2021 1y agoI once went really deep into fancy, fun generic Typescript types (think the kind of type that can verify whether a string is written in "SpongebobMemecase" like "tHiS" vs "this"), and Typescript types can and do use ternary and rest operators