MCPcopy Create free account
hub / github.com/sindresorhus/query-string / sort

Function sort

test/parse.js:73–73  ·  view source on GitHub ↗
(key1, key2)

Source from the content-addressed store, hash-verified

71test('should sort parsed keys in given order', () => {
72 const fixture = ['c', 'a', 'b'];
73 const sort = (key1, key2) => fixture.indexOf(key1) - fixture.indexOf(key2);
74
75 const parsed = queryString.parse('a=foo&b=bar&c=yay', {sort});
76 for (const [index, key] of Object.keys(parsed).entries()) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected