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.
Files changed (2) hide show
  1. package/dist/form.js +6 -1
  2. 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
- target[name] = has ? [target[name], value].flat() : value; // given again: a list
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fondu",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "A small meta-framework for full-stack React apps, built on Hono and Vite. It runs on Bun, Cloudflare Workers and Node.",
5
5
  "keywords": [
6
6
  "bun",