You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whatwg/url#26 proposes adding a sort() capability to URLSearchParams. The idea would be to have a simple default lexical sort of keys. If added, we would need to add this to the API
If we use an array of tuples as the underlying data structure instead of flattening them out, we can just use Array.prototype.sort. Any reason they must be flattened?
Also I remember there was discussion about moving the parsing bit to C++, for reference, blink does it with a Vector<std::pair<String, String>> and gecko does it with a nsTArray<Param>(essentially a vector with pair of strings too)
@joyeecheung, we can't use array.sort because it is not guaranteed to be stable, while the WHATWG spec does. In C++, creating new arrays for each tuple seems to be fairly expensive, so I decided on a flattened array instead.
whatwg/url#26 proposes adding a
sort()capability toURLSearchParams. The idea would be to have a simple default lexical sort of keys. If added, we would need to add this to the API