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

Function sort

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

Source from the content-addressed store, hash-verified

459test('should sort keys in given order', () => {
460 const fixture = ['c', 'a', 'b'];
461 const sort = (key1, key2) => fixture.indexOf(key1) - fixture.indexOf(key2);
462
463 assert.equal(queryString.stringify({a: 'foo', b: 'bar', c: 'baz'}, {sort}), 'c=baz&a=foo&b=bar');
464});

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected