Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
__s
6y ago
0 comments
Save
Share
TypeScript supports 'function f(x: any): x is T' as a way to declare that if f returns true, x may pass as type T
https://www.typescriptlang.org/docs/handbook/advanced-types....
0 comments
1 comments · 1 top-level
top
newest
oldest
cyral
6y ago
This package has an index.d.ts file that utilizes exactly this.
j
/
k
navigate · click thread line to collapse