Skip to content

Commit df4cbb3

Browse files
authored
Allow null and undefined in Stringifiable TypeScript type (#281)
1 parent 231c160 commit df4cbb3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,11 @@ export interface StringifyOptions {
339339
readonly skipEmptyString?: boolean;
340340
}
341341

342-
export type Stringifiable = string | boolean | number;
342+
export type Stringifiable = string | boolean | number | null | undefined;
343343

344344
export type StringifiableRecord = Record<
345345
string,
346-
Stringifiable | Stringifiable[] | null | undefined
346+
Stringifiable | Stringifiable[]
347347
>;
348348

349349
/**

index.test-d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,12 @@ expectType<string>(
9898
queryString.stringifyUrl({
9999
url: 'https://sindresorhus.com',
100100
query: {
101-
fooArray: [
101+
fooMixedArray: [
102102
'a',
103-
'b'
103+
1,
104+
true,
105+
null,
106+
undefined
104107
],
105108
fooNumber: 1,
106109
fooBoolean: true,

0 commit comments

Comments
 (0)