Skip to content

Commit e6314d4

Browse files
committed
doc: Note serialization guarantee
1 parent fad04f2 commit e6314d4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ Serialization uses
2121
[`URLSearchParams.toString()`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/toString#return_value)
2222
which encodes most non-alphanumeric characters.
2323

24-
- The primitive types `string`, `number`, and `bigint` are serialized using `.toString()`.
24+
Serialization is guaranteed to be well-defined within each type, i.e.,
25+
if the type of value for a given key in the query string is fixed and known by
26+
the consumer parsing the string, it can be unambigously parsed back to the original primitive value.
27+
28+
- The primitive type `string` is serialized using `.toString()`.
29+
- The primitive `number` and `bigint` types are serialized using `.toString()`.
2530
- The primitive `boolean` type is serialized using `.toString()`,
2631
e.g., `{ foo: true, bar: false }` serializes to `foo=true&bar=false`.
2732
- The primitive `null` and `undefined` values are removed,

0 commit comments

Comments
 (0)