I am trying to assign a type to my variable, that gets its value from express' Request query. The req.query is of type "QueryString.ParsedQs" and for example req.query.accountId is of type "string | QueryString.ParsedQs | string[] | QueryString.ParsedQs[]"
How could i extract the value from req.query.accountId to always be of type string?
Example code:
import { Request, Response } from "@feathersjs/express";
class Xyz {
public myMethod( req: Request, res: Response ){
const accountId =req.query.accountId;/* type is "string | QueryString.ParsedQs | string[] | QueryString.ParsedQs[]"*/
}
}