From 49d2203965f911940fb1b43c8263c8aaea5f95fd Mon Sep 17 00:00:00 2001 From: sn42 Date: Thu, 14 Mar 2019 12:13:40 +0100 Subject: [PATCH] Fix failing test and `ParsedQuery` TypeScript type (#170) --- index.d.ts | 2 +- test/stringify.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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'); });