Reputation: 53251
Do I need to write:
const response = (await got(url)) as got.Response<MyResponseType>;
or is this enough?
const response = await got(url) as got.Response<MyResponseType>;
I could not find a definitive resource on type casting operator precedence.
Upvotes: 4
Views: 345
Reputation: 5418
The second example works. Typecasting is always the last step, if not specified otherwise by using parenthesis.
Upvotes: 5