Skip to content

Interface: DecodeLimits ​

Resource limits for decoding. Positive numbers or Infinity (explicit opt-out).

Properties ​

PropertyTypeDescription
maxArrayLength?numberMax array, typed-array, buffer and collection entry count. Default 1,048,576.
maxDepth?numberMax structured-data and structured-clone nesting depth. Default 32.
maxInflatedBytes?numberMax total bytes inflated across all layers. Default 16 MiB. Each byte is counted once: nested layers are charged only for growth beyond their encoded input, which was already charged as part of the parent layer. Transient gross allocation while decoding is bounded by roughly maxDepth × maxInflatedBytes.