Typescript get type, that type guard function checks
Advertisements I have a type guard function for type User. How do I extract the type, that this function "guards"? Using ReturnType<typeof isUser> obviously does not work since the return type of the function is boolean, not User. type User = { username: string } function isUser(value: unknown): value is User { return value !==… Read More Typescript get type, that type guard function checks