File tree 2 files changed +7
-17
lines changed
2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -1062,16 +1062,14 @@ function parseKeyValue(/**string*/keyValue) {
1062
1062
function toKeyValue ( obj ) {
1063
1063
var parts = [ ] ;
1064
1064
forEach ( obj , function ( value , key ) {
1065
- if ( value !== null ) {
1066
- if ( isArray ( value ) ) {
1067
- forEach ( value , function ( arrayValue ) {
1068
- parts . push ( encodeUriQuery ( key , true ) +
1069
- ( arrayValue === true ? '' : '=' + encodeUriQuery ( arrayValue , true ) ) ) ;
1070
- } ) ;
1071
- } else {
1065
+ if ( isArray ( value ) ) {
1066
+ forEach ( value , function ( arrayValue ) {
1072
1067
parts . push ( encodeUriQuery ( key , true ) +
1073
- ( value === true ? '' : '=' + encodeUriQuery ( value , true ) ) ) ;
1074
- }
1068
+ ( arrayValue === true ? '' : '=' + encodeUriQuery ( arrayValue , true ) ) ) ;
1069
+ } ) ;
1070
+ } else {
1071
+ parts . push ( encodeUriQuery ( key , true ) +
1072
+ ( value === true ? '' : '=' + encodeUriQuery ( value , true ) ) ) ;
1075
1073
}
1076
1074
} ) ;
1077
1075
return parts . length ? parts . join ( '&' ) : '' ;
Original file line number Diff line number Diff line change @@ -491,14 +491,6 @@ describe('angular', function() {
491
491
expect ( toKeyValue ( { key : [ 323 , 'value' , true , 1234 ] } ) ) .
492
492
toEqual ( 'key=323&key=value&key&key=1234' ) ;
493
493
} ) ;
494
-
495
- it ( 'should not serialize null values' , function ( ) {
496
- expect ( toKeyValue ( { nullKey : null , key : 'value' } ) ) . toEqual ( 'key=value' ) ;
497
- } ) ;
498
-
499
- it ( 'should not serialize undefined' , function ( ) {
500
- expect ( toKeyValue ( { undefinedKey : undefined , key : 'value' } ) ) . toEqual ( 'key=value' ) ;
501
- } ) ;
502
494
} ) ;
503
495
504
496
You can’t perform that action at this time.
0 commit comments