Hacker News new | comments | show | ask | jobs | submit login


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.

Github has a nice little feature called issue tracking. Feel free to post your thoughts there. I'd be happy to figure something out. URI.js wasn't intended to limit anyone in what they were trying to do. It just never occured to me that ?foo=bar&foo=bar could be intentional.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact