Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix failing test and ParsedQuery TypeScript type (#170)
  • Loading branch information
sn42 authored and sindresorhus committed Mar 14, 2019
1 parent c138b11 commit 49d2203
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Expand Up @@ -33,7 +33,7 @@ export interface ParseOptions {
}

export interface ParsedQuery {
readonly [key: string]: string | string[] | undefined;
readonly [key: string]: string | string[] | null | undefined;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/stringify.js
Expand Up @@ -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');
});
Expand Down

0 comments on commit 49d2203

Please sign in to comment.