File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,13 +28,17 @@ function getAsPrimitive(value) {
2828function stringify ( input ) {
2929 let result = "" ;
3030
31+ if ( input === null || typeof input !== 'object' ) {
32+ return result ;
33+ }
34+
3135 const keys = Object . keys ( input ) ;
3236 const keyLength = keys . length ;
3337
3438 for ( let i = 0 ; i < keyLength ; i ++ ) {
3539 const key = keys [ i ] ;
3640 const value = input [ key ] ;
37- const encodedKey = encodeString ( key ) ;
41+ const encodedKey = encodeString ( key ) + "=" ;
3842
3943 if ( i ) {
4044 result += "&" ;
@@ -47,10 +51,10 @@ function stringify(input) {
4751 result += "&" ;
4852 }
4953
50- result += encodedKey + "=" + getAsPrimitive ( value [ j ] ) ;
54+ result += encodedKey + getAsPrimitive ( value [ j ] ) ;
5155 }
5256 } else {
53- result += encodedKey + "=" + getAsPrimitive ( value ) ;
57+ result += encodedKey + getAsPrimitive ( value ) ;
5458 }
5559 }
5660
You can’t perform that action at this time.
0 commit comments