DecoderOptions: {
    ignoreExtraData?: boolean;
    noCopy?: boolean;
    strictMapKeys?: boolean;
    taggedDecoders?: TaggedDecoder<any>[];
    uniqueMapKeys?: boolean;
}

Specifies options for decoder.

Type declaration

  • OptionalignoreExtraData?: boolean

    If true, ignore extra data at the end of the source buffer. Otherwise, decoder throws an error if extra data is detected.

    To get the number of extra bytes left, use undecodedLength.

    By default, false.

  • OptionalnoCopy?: boolean

    If true, instead of copying byte arrays return subarrays into CBOR buffer.

    By default, false.

  • OptionalstrictMapKeys?: boolean

    If true, allow only string and number keys for maps. Throw if encountered any other type.

    By default, false.

  • OptionaltaggedDecoders?: TaggedDecoder<any>[]

    Tagged object decoders.

    By default, DEFAULT_TAGGED_DECODERS, which converts tagged Tags.DateString and Tags.DateNumber to Date and Tags.RegExp to RegExp objects.

    Pass empty array to disable tagged decoders.

  • OptionaluniqueMapKeys?: boolean

    If true, map keys must be unique (after conversion to string). Throw if encountered duplicate keys.

    By default, false.