diff --git a/index.d.ts b/index.d.ts index 8d34e213..e8c91d00 100644 --- a/index.d.ts +++ b/index.d.ts @@ -33,7 +33,7 @@ export interface ParseOptions { } export interface ParsedQuery { - readonly [key: string]: string | string[] | undefined; + readonly [key: string]: string | string[] | null | undefined; } /** diff --git a/test/stringify.js b/test/stringify.js index 0302b507..1c16d994 100644 --- a/test/stringify.js +++ b/test/stringify.js @@ -134,7 +134,7 @@ test('array stringify representation with array indexes and sparse array', t => test('should sort keys in given order', t => { const order = ['c', 'a', 'b']; - const sort = (key1, key2) => order.indexOf(key1) >= order.indexOf(key2); + const sort = (key1, key2) => order.indexOf(key1) - order.indexOf(key2); t.is(m.stringify({a: 'foo', b: 'bar', c: 'baz'}, {sort}), 'c=baz&a=foo&b=bar'); });