SplitResult typedef
Decoder: query-string → nested Dart maps/lists (Node qs
parity)
This module mirrors the semantics of the original qs
(https://github.com/ljharb/qs):
- Bracket notation drives structure (e.g.
a[b][0]=1
). - Optional dot-notation can be accepted and normalized to brackets when
DecodeOptions.allowDots
is true (e.g.a.b
→a[b]
). - Depth limiting (
depth
) behaves likeqs
: depth=0 disables splitting;strictDepth=true
throws when nesting exceeds the limit; otherwise the remainder is kept as a single segment. - Charset sentinel (
utf8=
) handling matchesqs
. - Duplicate key handling (
duplicates
) and list parsing (parseLists
,allowEmptyLists
,allowSparseLists
,listLimit
) follow the reference.
Implementation notes:
- We decode key parts lazily and then "reduce" right-to-left to build the
final structure in
_parseObject
. - We never mutate caller-provided containers; fresh maps/lists are created.
- No behavioral changes are introduced here; comments only. Split operation result used by the decoder helpers.
parts
: collected key segments.exceeded
: indicates whether a configured limit was exceeded during split.
Implementation
/// Split operation result used by the decoder helpers.
/// - `parts`: collected key segments.
/// - `exceeded`: indicates whether a configured limit was exceeded during split.
typedef SplitResult = ({List<String> parts, bool exceeded});