Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants