DecodeOptions class final
Options that configure the output of QS.decode.
- Mixed in types
Constructors
- DecodeOptions({bool? allowDots, Decoder? decoder, bool? decodeDotInKeys, bool allowEmptyLists = false, int listLimit = 20, Encoding charset = utf8, bool charsetSentinel = false, bool comma = false, Pattern delimiter = '&', int depth = 5, Duplicates duplicates = Duplicates.combine, bool ignoreQueryPrefix = false, bool interpretNumericEntities = false, num parameterLimit = 1000, bool parseLists = true, bool strictDepth = false, bool strictNullHandling = false})
-
const
Properties
- allowDots → bool
-
Set to
true
to decode dot Map notation in the encoded input.final - allowEmptyLists → bool
-
Set to
true
to allow empty List values inside Maps in the encoded input.final - charset → Encoding
-
The character encoding to use when decoding the input.
final
- charsetSentinel → bool
-
Some services add an initial
utf8=✓
value to forms so that old InternetExplorer versions are more likely to submit the form as utf8. Additionally, the server can check the value against wrong encodings of the checkmark character and detect that a query string orapplication/x-www-form-urlencoded
body was not sent as utf8, eg. if the form had anaccept-charset
parameter or the containing page had a different character set.final - comma → bool
-
Set to
true
to parse the input as a comma-separated value.final - decodeDotInKeys → bool
-
Set to
true
to decode dots in keys.final - delimiter → Pattern
-
The delimiter to use when splitting key-value pairs in the encoded input.
Can be a String or a RegExp.
final
- depth → int
-
By default, when nesting Maps QS will only decode up to 5 children deep.
This depth can be overridden by setting the depth.
The depth limit helps mitigate abuse when qs is used to parse user input,
and it is recommended to keep it a reasonably small number.
final
- duplicates → Duplicates
-
Change the duplicate key handling strategy
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- ignoreQueryPrefix → bool
-
Set to
true
to ignore the leading question mark query prefix in the encoded input.final - interpretNumericEntities → bool
-
Set to
true
to interpret HTML numeric entities (&#...;
) in the encoded input.final - listLimit → int
-
QS will limit specifying indices in a List to a maximum index of
20
. Any List members with an index of greater than20
will instead be converted to a Map with the index as the key. This is needed to handle cases when someone sent, for example,a[999999999]
and it will take significant time to iterate over this huge List. This limit can be overridden by passing an listLimit option.final - parameterLimit → num
-
For similar reasons, by default QS will only parse up to 1000
parameters. This can be overridden by passing a parameterLimit
option.
final
- parseLists → bool
-
To disable List parsing entirely, set parseLists to
false
.final -
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strictDepth → bool
-
Set to
true
to add a layer of protection by throwing an error when the limit is exceeded, allowing you to catch and handle such cases.final - strictNullHandling → bool
-
Set to true to decode values without
=
tonull
.final - stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited
Methods
-
copyWith(
{bool? allowDots, bool? allowEmptyLists, int? listLimit, Encoding? charset, bool? charsetSentinel, bool? comma, bool? decodeDotInKeys, Pattern? delimiter, int? depth, Duplicates? duplicates, bool? ignoreQueryPrefix, bool? interpretNumericEntities, num? parameterLimit, bool? parseLists, bool? strictNullHandling, bool? strictDepth, Decoder? decoder}) → DecodeOptions - Returns a new DecodeOptions instance with updated values.
-
decoder(
String? value, {Encoding? charset}) → dynamic - Decode the input using the specified Decoder.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited