fast-querystring introduces several benefits when used to encode query strings:
Unsafe URL characters are automatically encoded such that they are not misinterpreted by the server
Suppose an endpoint has t.String({ format: 'email' }) on the query validator. If you tried to set the query string to test+1@test.com validation would fail because for some reason, the server would see the value as test+ @test.com or something. See: https://stackoverflow.com/questions/2322764/what-characters-must-be-escaped-in-an-http-query-string
By using this package we solve this problem with minimal impact to perf.
Able to encode arrays
Looking at the example posted on the readme in the fast-querystring repo:
We see that fast-querystring will also handle arrays. This is helpful when you have situations where you might want to apply multiple filters to a data-table component and much more.
fast-querystring
introduces several benefits when used to encode query strings:Unsafe URL characters are automatically encoded such that they are not misinterpreted by the server Suppose an endpoint has
t.String({ format: 'email' })
on the query validator. If you tried to set the query string totest+1@test.com
validation would fail because for some reason, the server would see the value astest+ @test.com
or something. See: https://stackoverflow.com/questions/2322764/what-characters-must-be-escaped-in-an-http-query-string By using this package we solve this problem with minimal impact to perf.Able to encode arrays Looking at the example posted on the readme in the
fast-querystring
repo:We see that
fast-querystring
will also handle arrays. This is helpful when you have situations where you might want to apply multiple filters to a data-table component and much more.