Serialize: Fix object detection

jQuery.type doesn't just return "null" for null but also e.g. "array"
for arrays instead of object so it's not really a typeof analogue.

My suggestion was stupid. Sorry.

Refs 3d7ce0a65f
This commit is contained in:
Michał Gołębiowski 2015-09-07 23:22:56 +02:00
parent 3d7ce0a65f
commit 14c0fe4432

View File

@ -28,7 +28,7 @@ function buildParams( prefix, obj, traditional, add ) {
// Item is non-scalar (array or object), encode its numeric index.
buildParams(
prefix + "[" + ( jQuery.type( v ) === "object" ? i : "" ) + "]",
prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
v,
traditional,
add