From 9b39c4ece4c4a6029ee82d35b895b96a685a9d2d Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 6 Nov 2025 09:49:16 -0800 Subject: [PATCH 1/3] doc: Note on empty objects --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 268507e..ef31554 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 From c1f204660852b9d0e173811ec9203d084197be9b Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 6 Nov 2025 09:49:31 -0800 Subject: [PATCH 2/3] Note on parsing empty strings --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef31554..fa9fe74 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,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`. From 4d474f5328b62d89edc3af1a1b2a7df23997472f Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Thu, 6 Nov 2025 09:50:29 -0800 Subject: [PATCH 3/3] --wip-- [skip ci] --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index fa9fe74..d15b889 100644 --- a/README.md +++ b/README.md @@ -69,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.,