Filter
Exclude
Time range
-
Near
Replying to @housecor
Or at a minimum, typeguards that help you narrow
1
143
5 Feb 2025
[388844115][turbofan] Make map inferring work across TypeGuards chromium-review.googlesource…
1
1
595
28 May 2024
これenumとinputに対応できてないポイ "tyankatsu0105/graphql-code-generator-plugin-typescript-typename-typeguards: A plugin for graphql code generator that generate user defined type guards with __typename" github.com/tyankatsu0105/gra…
2
1,837
28 Mar 2024
I've created a lib that enables you to compose and chain typeguards. Many codebases already define some typeguards, but it's often challenging to chain them or craft the type signature for these guards. What are your thoughts? You can find the code in the first comment.
1
2
81
I really dislike writing type predicates/typeguards for `.filter()` - what other solutions are there other than using `.flatMap()`? `flatMap` works but it slows down JS unnecessarily and makes the code not look like you're filtering something
TypeScript tip 💡 Use `.flatMap()` to filter items in a type-safe manner. Try it 👉 typescriptlang.org/play?targ…
8
3
87
76,136
TIL asserts! I’ve been using bespoke typeguards (modified in a contrived way to fit your example here) for the very same use case up until now. This is so much better Thanks!
4
126
21 Nov 2023
typeguards with mapped types let you do some neat things
14
2
49
7,914
Replying to @mattpocockuk
Typeguards 🫶
4
669
#TypeScript Tip! 🚀 Running into issues where TS can't narrow down array types after filtering? Use Type Guards to refine types! 🛡️ #DevTips #TypeSafety #TypeGuards
1
3
93
Replying to @theo @t3dotgg
Have you considered using typeguards for filter?
1
2
18
1,024
Caso queira brincar com esse exemplo, testar ou modificar, aqui tá o link dele no playground de Typescript: typescriptlang.org/play?#cod… E isso são typeguards! espero que você tenha conseguido entender o tópico, mas fica a vontade pra mandar dúvidas nos comentários Até uma próxima!😊

13
1,128
Funny thing I have been finding out in this current project, exporting Typeguards is actually super-handy.
1
2
5 Nov 2022
I agree typeguards or tools like Zod are useful, but the question of whether to declare a return type on the function signature as well remains relevant in that case too.
25 Jul 2022
Brincando com typeguards, refinando um tipo dentro de um if
1
9
11 Jun 2022
For TypeScript devs: An introduction to TypeGuards #TypeScript #programmingtips
4
25 Feb 2022
any, as, unsafe typeguards, unsafe assumptions (qual o type do json que vem do server?)
2