samchon / typia

Super-fast/easy runtime validators and serializers via transformation
https://typia.io/
MIT License
4.65k stars 160 forks source link

Support for Record in query functions #1364

Open ramiroaisen opened 1 week ago

ramiroaisen commented 1 week ago

Feature Request

This isssue assumes first the implementation of #1363

We are using typia.http.assertQuery in an API we are developing.

In a place we need to accept a custom attributes filter in the form of Record<string, string>

So a query like this:

type Query = {
  attrs: Record<string, string>,
}

could be parsed from a string like this ?attrs[foo]=bar&attrs[baz]=das

And the parsing should correctly resolve to an object like this:

{
  attrs: {
    foo: "bar",
    baz: "das",
  }
}

That shape correctly match the expected format.