form-serialize
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -0,1 +1,5 @@ | ||
# 0.4.1 (2015-01-15) | ||
* fix nested [][] serialization | ||
# 0.4.0 (2014-12-16) | ||
@@ -2,0 +6,0 @@ |
@@ -177,3 +177,3 @@ // get successful control from form and assemble into object | ||
// This is a nested key, set it properly for the next iteration | ||
parent[child] = {}; | ||
parent[child] = parent[child] || {}; | ||
parent = parent[child]; | ||
@@ -180,0 +180,0 @@ } |
{ | ||
"name": "form-serialize", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "serialize html forms", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -187,2 +187,3 @@ var assert = require('assert'); | ||
'<input type="text" name="account[address][city]" value="Qux">' + | ||
'<input type="text" name="account[address][state]" value="CA">' + | ||
'<select name="beer[type]" multiple>' + | ||
@@ -200,3 +201,4 @@ ' <option value="ipa" selected>IPA</option>' + | ||
address: { | ||
city: 'Qux' | ||
city: 'Qux', | ||
state: 'CA' | ||
} | ||
@@ -208,3 +210,3 @@ }, | ||
}); | ||
str_check(form, 'account%5Bname%5D=Foo+Dude&account%5Bemail%5D=foobar%40example.org&account%5Baddress%5D%5Bcity%5D=Qux&beer%5Btype%5D=ipa&beer%5Btype%5D=amber-ale'); | ||
str_check(form, 'account%5Bname%5D=Foo+Dude&account%5Bemail%5D=foobar%40example.org&account%5Baddress%5D%5Bcity%5D=Qux&account%5Baddress%5D%5Bstate%5D=CA&beer%5Btype%5D=ipa&beer%5Btype%5D=amber-ale'); | ||
}); |
17551
337