File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export function resolveQuery (
3838 return parsedQuery
3939}
4040
41- const castQueryParamValue = value => ( value == null ? value : String ( value ) )
41+ const castQueryParamValue = value => ( value == null || typeof value === 'object' ? value : String ( value ) )
4242
4343function parseQuery ( query : string ) : Dictionary < string > {
4444 const res = { }
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ describe('Query utils', () => {
2525 expect ( query ) . toEqual ( { a : undefined , b : null } )
2626 } )
2727
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+
2833 it ( 'should keep null query values in arrays' , ( ) => {
2934 const query = resolveQuery ( '' , { baz : [ null , '2' ] } )
3035 expect ( query ) . toEqual ( { baz : [ null , '2' ] } )
You can’t perform that action at this time.
0 commit comments