typia.http.isQuery() is a function decoding a query string or an
URLSearchParams instance, with automatic type casting to the expected type.
When property type be defined as boolean or number type,
typia.http.isQuery() will cast the value to the expected type when decoding.
Also, after decoding, typia.http.isQuery() performs type checking to the
decoded value by combining with is function. Therefore, when the
decoded value is not following the T type, null value would be returned.
By the way, as URL query is not enough to express complex data structures,
typia.http.isQuery() function has some limitations. If target type T is
notfollowing those restrictions, compilation errors would be occured.
Type T must be an object type
Do not allow dynamic property
Only boolean, bigint, number, string or their array types are allowed
URL query decoder with type checking.
typia.http.isQuery()
is a function decoding a query string or anURLSearchParams
instance, with automatic type casting to the expected type. When property type be defined asboolean
ornumber
type,typia.http.isQuery()
will cast the value to the expected type when decoding.Also, after decoding,
typia.http.isQuery()
performs type checking to the decoded value by combining with is function. Therefore, when the decoded value is not following theT
type,null
value would be returned.By the way, as URL query is not enough to express complex data structures,
typia.http.isQuery()
function has some limitations. If target typeT
is notfollowing those restrictions, compilation errors would be occured.T
must be an object typeboolean
,bigint
,number
,string
or their array types are allowed