diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2016-07-15 21:42:25 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-15 21:42:25 +0400 |
commit | e4fd41f8fa4190fbbb6cb98cf7ace64f6e00685d (patch) | |
tree | c9957f8e6da0b814dfd11a5d1d61d969f7be4efd /src/serialize.js | |
parent | 96966c022079e3956018717136367fbf4ed548a2 (diff) | |
download | jquery-e4fd41f8fa4190fbbb6cb98cf7ace64f6e00685d.tar.gz jquery-e4fd41f8fa4190fbbb6cb98cf7ace64f6e00685d.zip |
Build: Update eslint config and fix associated errors
Diffstat (limited to 'src/serialize.js')
-rw-r--r-- | src/serialize.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/serialize.js b/src/serialize.js index 60d936251..35dcf04f9 100644 --- a/src/serialize.js +++ b/src/serialize.js @@ -111,13 +111,17 @@ jQuery.fn.extend( { .map( function( i, elem ) { var val = jQuery( this ).val(); - return val == null ? - null : - jQuery.isArray( val ) ? - jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ) : - { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + if ( val == null ) { + return null; + } + + if ( jQuery.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ).get(); } } ); |