form-data-set
Advanced tools
Comparing version 1.2.0 to 2.0.0
@@ -9,2 +9,5 @@ var walk = require('dom-walk') | ||
var hash = {} | ||
if (rootElem.name) { | ||
hash[rootElem.name] = rootElem | ||
} | ||
@@ -11,0 +14,0 @@ walk(rootElem, function (child) { |
{ | ||
"name": "form-data-set", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "Extract form data from a hash of elements", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -5,2 +5,3 @@ var test = require("tape") | ||
var FormData = require("../index") | ||
var getFormData = require("../element") | ||
@@ -24,1 +25,18 @@ test("FormData works with <select> elements", function (assert) { | ||
}) | ||
test("getFormData works when root element has a name", function(assert) { | ||
var element = h("select", { | ||
name: "foo" | ||
}, [ | ||
h("option", { value: "one" }) | ||
, h("option", { value: "two", selected: true }) | ||
]) | ||
var data = getFormData(element) | ||
assert.deepEqual(data, { | ||
foo: "two" | ||
}) | ||
assert.end() | ||
}) |
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
16831
19
348