Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use URLSearchParams for paramsObject #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cailyncodes
Copy link

Implements feature in issue #88.

This pull request changes the object of paramsObject from a native JS object to a URLSearchParams object. The actual implementation is simple -- most of it is removing code because URLSeachParams handles everything. The bulk of the changes are changes to the tests because this is a breaking change.

…o expect URLSearchParams objects

Add utility methods for URLSearchParams: URLSearchParams don't have notions of equality defined in the spec, so we go through iterating over all entries checking for equality for testing purposes; Chrome (v60) currently doesn't support constructing URLSearchParams from objects, so add utility method to convert objects into arrays of pairs

Update tests to expect URLSearchParams for search query: Tests that would normally expect objects for search params now expect URLSearchParams; add test for multiple values same key

Implement URLSearchParams for search query: Most of the work is offloaded to URLSearchParams re: parsing and serializing, this change is predominatly updating the type of paramsObject

Add polyfill for URLSearchParams: I.E. does not implement URLSearchParams
@ernsheong
Copy link

Unfortunately the extra dependency makes this unappealing I suppose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants