Issue
I'm destructing an object as following:
const { lang, ...params } = ctx.query;
But TS gives me an error in this line:
if (!value.includes(params[key])) return false;
How can I solve this issue?
Solution
Use .includes(params[key] as string) (or .includes(<string>params[key])) to tell Typescript you know it's a string.
Answered By - Jeremy Thille

0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.