{"action":"created","issue":{"url":"https://api.github.com/repos/medialize/URI.js/issues/256","labels_url":"https://api.github.com/repos/medialize/URI.js/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/medialize/URI.js/issues/256/comments","events_url":"https://api.github.com/repos/medialize/URI.js/issues/256/events","html_url":"https://github.com/medialize/URI.js/issues/256","id":110947861,"number":256,"title":"removeQuery won't remove the last value of a variable if provided in an Array","user":{"login":"Siltaar","id":1504433,"avatar_url":"https://avatars.githubusercontent.com/u/1504433?v=3","gravatar_id":"","url":"https://api.github.com/users/Siltaar","html_url":"https://github.com/Siltaar","followers_url":"https://api.github.com/users/Siltaar/followers","following_url":"https://api.github.com/users/Siltaar/following{/other_user}","gists_url":"https://api.github.com/users/Siltaar/gists{/gist_id}","starred_url":"https://api.github.com/users/Siltaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Siltaar/subscriptions","organizations_url":"https://api.github.com/users/Siltaar/orgs","repos_url":"https://api.github.com/users/Siltaar/repos","events_url":"https://api.github.com/users/Siltaar/events{/privacy}","received_events_url":"https://api.github.com/users/Siltaar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-12T10:25:37Z","updated_at":"2015-10-12T13:02:43Z","closed_at":null,"body":"Hi,\r\n\r\nTo have easy interactions between json objects and Search/Query serialisation, I addQuery and removeQuery elements always providing a list. This works great except it removeQuery, not removing the last value of a multi-value GET variable, if this value is specified via a singleton list (which is not illegal).\r\n\r\nI am to provide a pull request fixing this small issue."},"comment":{"url":"https://api.github.com/repos/medialize/URI.js/issues/comments/147392256","html_url":"https://github.com/medialize/URI.js/issues/256#issuecomment-147392256","issue_url":"https://api.github.com/repos/medialize/URI.js/issues/256","id":147392256,"user":{"login":"Siltaar","id":1504433,"avatar_url":"https://avatars.githubusercontent.com/u/1504433?v=3","gravatar_id":"","url":"https://api.github.com/users/Siltaar","html_url":"https://github.com/Siltaar","followers_url":"https://api.github.com/users/Siltaar/followers","following_url":"https://api.github.com/users/Siltaar/following{/other_user}","gists_url":"https://api.github.com/users/Siltaar/gists{/gist_id}","starred_url":"https://api.github.com/users/Siltaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Siltaar/subscriptions","organizations_url":"https://api.github.com/users/Siltaar/orgs","repos_url":"https://api.github.com/users/Siltaar/repos","events_url":"https://api.github.com/users/Siltaar/events{/privacy}","received_events_url":"https://api.github.com/users/Siltaar/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T13:02:43Z","updated_at":"2015-10-12T13:02:43Z","body":"The fix is simple (I wait your approval to provide it as a push-request) : \r\n---\r\n src/URI.js | 2 +-\r\n 1 file changed, 1 insertion(+), 1 deletion(-)\r\n\r\ndiff --git a/src/URI.js b/src/URI.js\r\nindex 739f788..d9e0989 100644\r\n--- a/src/URI.js\r\n+++ b/src/URI.js\r\n@@ -777,7 +777,7 @@\r\n           } else {\r\n             data[name] = filterArrayValues(data[name], value);\r\n           }\r\n-        } else if (data[name] === value) {\r\n+        } else if (data[name] === value || (isArray(value) && data[name] === String(value[0])))\r\n           data[name] = undefined;\r\n         } else if (isArray(data[name])) {\r\n           data[name] = filterArrayValues(data[name], value);\r\n"}}