import { type DecodingOptions } from "https://deno.land/x/bencodex@0.2.2/src/decoder.ts";
Options for decoding a Bencodex value.
Properties
Whether to silently ignore or stop decoding and report an error when
dictionary keys are not ordered according to the Bencodex specification.
The default value is "error"
.
When this option is set to "ignore"
and the decoder encounters
duplicate dictionary keys, the behavior is undefined and depends on the
implementation of the dictionaryConstructor
. In case of
BencodexDictionary (default), the key appeared the latest will be
used.
When this option is set to "error"
, decode function throws
an DecodingErrorKind when it encounters duplicate dictionary keys.
The Dictionary type to use for representing decoded dictionaries.
The default value is BencodexDictionary. You can set this option
to other implementations of Dictionary such as Map<Key, Value>
.