Skip to main content
Version: v0.0.3

Interface: CcdaParseLimits

Hard safety limits applied to every parse before the XML is handed to the DOM. Each cap defends a specific denial-of-service vector for hostile XML (oversized payloads, billion-laughs entity expansion, pathological element nesting). All four have library defaults; callers may tighten, or, at their own risk, loosen, any of them via ParseCcdaOptions.limits.

Example

import type { CcdaParseLimits } from "@cosyte/ccda";
const tight: CcdaParseLimits = { maxInputBytes: 1_000_000, maxDepth: 100 };

Properties

maxDepth?

readonly optional maxDepth?: number

Maximum element nesting depth. Exceeding it throws ELEMENT_DEPTH_LIMIT_EXCEEDED.


maxEntityExpansions?

readonly optional maxEntityExpansions?: number

Maximum count of &...; entity references permitted in the raw input.


maxInputBytes?

readonly optional maxInputBytes?: number

Maximum decoded input size in bytes. Exceeding it throws INPUT_SIZE_LIMIT_EXCEEDED.


maxNodeCount?

readonly optional maxNodeCount?: number

Maximum total element-node count. Exceeding it throws NODE_COUNT_LIMIT_EXCEEDED.