File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -350,7 +350,12 @@ export type StringifiableRecord = Record<
350
350
Stringify an object into a query string and sort the keys.
351
351
*/
352
352
export function stringify (
353
- object : StringifiableRecord ,
353
+ // TODO: Use the below instead when the following TS issues are fixed:
354
+ // - https://github.com/microsoft/TypeScript/issues/15300
355
+ // - https://github.com/microsoft/TypeScript/issues/42021
356
+ // Context: https://github.com/sindresorhus/query-string/issues/298
357
+ // object: StringifiableRecord,
358
+ object : Record < string , any > ,
354
359
options ?: StringifyOptions
355
360
) : string ;
356
361
Original file line number Diff line number Diff line change @@ -35,6 +35,17 @@ expectType<string>(
35
35
)
36
36
) ;
37
37
38
+ // Ensure it accepts an `interface`.
39
+ interface Query {
40
+ foo : string ;
41
+ }
42
+
43
+ const query : Query = {
44
+ foo : 'bar'
45
+ } ;
46
+
47
+ queryString . stringify ( query ) ;
48
+
38
49
// Parse
39
50
expectType < queryString . ParsedQuery > ( queryString . parse ( '?foo=bar' ) ) ;
40
51
You can’t perform that action at this time.
0 commit comments