File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export function resolveQuery (
38
38
return parsedQuery
39
39
}
40
40
41
- const castQueryParamValue = value => ( value == null ? value : String ( value ) )
41
+ const castQueryParamValue = value => ( value == null || typeof value === 'object' ? value : String ( value ) )
42
42
43
43
function parseQuery ( query : string ) : Dictionary < string > {
44
44
const res = { }
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ describe('Query utils', () => {
25
25
expect ( query ) . toEqual ( { a : undefined , b : null } )
26
26
} )
27
27
28
+ it ( 'should keep objects query values' , ( ) => {
29
+ const query = resolveQuery ( '' , { a : { nested : 'o' } , b : [ { a : true } ] } )
30
+ expect ( query ) . toEqual ( { a : { nested : 'o' } , b : [ { a : true } ] } )
31
+ } )
32
+
28
33
it ( 'should keep null query values in arrays' , ( ) => {
29
34
const query = resolveQuery ( '' , { baz : [ null , '2' ] } )
30
35
expect ( query ) . toEqual ( { baz : [ null , '2' ] } )
You can’t perform that action at this time.
0 commit comments