form-serialize
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -0,1 +1,5 @@ | ||
# 0.5.0 (2015-02-08) | ||
* fix specifying custom serializer | ||
# 0.4.1 (2015-01-15) | ||
@@ -2,0 +6,0 @@ |
@@ -35,3 +35,3 @@ // get successful control from form and assemble into object | ||
var result = (options.hash) ? {} : ''; | ||
var serializer = options.serializer || (options.hash) ? hash_serializer : str_serialize; | ||
var serializer = options.serializer || ((options.hash) ? hash_serializer : str_serialize); | ||
@@ -38,0 +38,0 @@ var elements = form.elements || []; |
{ | ||
"name": "form-serialize", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "serialize html forms", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -210,1 +210,14 @@ var assert = require('assert'); | ||
}); | ||
test('custom serializer', function() { | ||
var form = domify('<form><input type="text" name="node" value="zuul">/</form>'); | ||
assert.deepEqual(serialize(form, { | ||
serializer: function(curry, k, v) { | ||
curry[k] = 'ZUUL'; | ||
return curry; | ||
} | ||
}), { | ||
"node": "ZUUL" | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17900
348