Skip to content

Commit a170490

Browse files
committed
⚡ enhance object parsing logic to initialize obj with the first valid dict
1 parent 3569463 commit a170490

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/qs_codec/decode.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ def decode(
4141
if temp_obj:
4242
for key, val in temp_obj.items():
4343
new_obj: t.Any = _parse_keys(key, val, options, isinstance(value, str))
44+
45+
if not obj and isinstance(new_obj, dict):
46+
obj = new_obj
47+
continue
48+
4449
obj = Utils.merge(obj, new_obj, options) # type: ignore [assignment]
4550

4651
return Utils.compact(obj)

0 commit comments

Comments
 (0)