You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default arrayFormat value of none is problematic because arrays of length 1 are serialised to the same format as if the value was the string contained within the array.
Perhaps the default arrayFormat should be changed to bracket or index, which do not have this problem. The none option would make more sense IMO if it refused to stringify an array when stringifying, and ignored/crash for duplicate keys when parsing. I don't see how the comma option can be made to handle arrays consistently.
The text was updated successfully, but these errors were encountered:
While I agree with you it's not optimal, people have been using this for years without complaining, so it cannot be that big of an issue. Not sure it's worth doing a breaking change to change the default, but we should at least make the "catches" clearer in the docs.
The default
arrayFormat
value ofnone
is problematic because arrays of length 1 are serialised to the same format as if the value was the string contained within the array.For example:
Perhaps the default
arrayFormat
should be changed tobracket
orindex
, which do not have this problem. Thenone
option would make more sense IMO if it refused to stringify an array when stringifying, and ignored/crash for duplicate keys when parsing. I don't see how thecomma
option can be made to handle arrays consistently.The text was updated successfully, but these errors were encountered: