by mmatants · 14y ago · 0 comments
So the current behaviour is to turn "?&foo=bar&&foo=bar" into "?foo=bar". I've coded a few client-side scripts where removal of unneeded ampersands was useful, but at the same time I needed to keep both repeated name-value pairs (for more advanced form submissions).
I would suggest making normalizeSearch less destructive - i.e. only targeting the unused question mark and ampersands - and splitting the name-value pair deduplication into a separate method.
Liking the jQuery-style method chaining.