aboutsummaryrefslogtreecommitdiffstats
path: root/src/serialize.js
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2016-07-15 21:42:25 +0400
committerGitHub <noreply@github.com>2016-07-15 21:42:25 +0400
commite4fd41f8fa4190fbbb6cb98cf7ace64f6e00685d (patch)
treec9957f8e6da0b814dfd11a5d1d61d969f7be4efd /src/serialize.js
parent96966c022079e3956018717136367fbf4ed548a2 (diff)
downloadjquery-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.js18
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();
}
} );