When I receive a query string in one of my REST endpoints using koa-router, each value of the query string object parameter is always a string:
{
count: "120",
result: "true",
text: "ok"
}
Within my codebase, I have an Interface that represents the query string object:
interface Params {
count: number;
result: boolean;
text: string;
}
I aim to convert the query string object so that all values match this interface. What are the best practices for accomplishing this?