diff --git a/README.md b/README.md index 268507e..d15b889 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ which encodes most non-alphanumeric characters. to dot-path format and then serializes the values as above, e.g., `{ foo: 'a', bar: { baz: 'b', fizz: [1, 2] } }` serializes to `foo=a&bar.baz=b&bar.fizz=1&bar.fizz=2`. +- Empty objects are serialized to `undefined`, e.g., + `{ foo: {}, bar: { baz: {} }, fizz: 1 }` serializes to `fizz=1`. - Serialization of keys containing a `.` is not supported and will throw an `UnserializableParamError`. - Serialization of nested arrays or objects nested inside arrays @@ -67,6 +69,10 @@ which encodes most non-alphanumeric characters. - Serialization of `NaN`, `Infinity`, and `-Infinity` is not supported and will throw an `UnserializableParamError`. +#### Why is the empty string and empty object parsed as undefined but not the empty array? + +TODO + ### Compatible parsing strategy Serialization is guaranteed to be well-defined within each type, i.e., @@ -82,7 +88,7 @@ the consumer parsing the string, it can be unambigously parsed back to the origi ##### Primitive - `string | null`. - - Excludes zero-length strings. + - Excludes zero-length strings or treats them incidentally as `undefined`. - `number | null`. - `bigint | null`. - `boolean | null`.