Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,27 @@ The output type is intentionally flat:
Record<string, string | File>;
```

### Why no multiple values or repeated keys?

HTML FormData allows the same key to appear multiple times
(e.g. multi-select inputs or repeated checkboxes).

safe-formdata intentionally treats repeated keys as a boundary violation
and reports them as `duplicate_key` issues.

While multiple values may be semantically valid in application logic,
their interpretation necessarily implies structure
(e.g. arrays, sets, ordering, or merging rules).

Defining or inferring such structure is outside the scope of safe-formdata.

safe-formdata establishes a strict, non-inferential boundary:
each key must map to exactly one value (`string` or `File`),
or the input is rejected.

If multiple values are required, they must be normalized
before or outside this boundary.

### Why no throwing or `parseOrThrow`?

FormData is external input.
Expand Down