fondu 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form.js +6 -1
- package/package.json +1 -1
package/dist/form.js
CHANGED
|
@@ -35,7 +35,12 @@ export function formObject(entries) {
|
|
|
35
35
|
if (i === path.length - 1) {
|
|
36
36
|
if (has && isObject(target[name]))
|
|
37
37
|
throw new MalformedForm(`\`${key}\` is both a value and an object`);
|
|
38
|
-
|
|
38
|
+
// given again: a list, added to in place (a copy for each value is quadratic: a small body, much work)
|
|
39
|
+
const previous = target[name];
|
|
40
|
+
if (Array.isArray(previous))
|
|
41
|
+
previous.push(value);
|
|
42
|
+
else
|
|
43
|
+
target[name] = has ? [previous, value] : value;
|
|
39
44
|
}
|
|
40
45
|
else {
|
|
41
46
|
if (!has)
|