Skip to content

Configuration: Parser

Madeline Kahn edited this page Dec 30, 2025 · 1 revision

You can pass a CDIFParserOptions object to CDIF.parse() to customize the behavior of the parser. All values are optional, and will fall back to a default value if they are omitted or undefined. The available options in CDIFParserOptions are as follows:

useBigInt

useBigInt?: boolean;

If true, integer values will be parsed as bigint to preserve precision of large integers.

Default value: false

postprocessors

postprocessors?: ReadonlyArray<CDIFParserPostprocessorFunction>;

Array of postprocessor functions, in order of precedence. Postprocessor functions are called for each value after parsing. They can be used to customize the behavior of the parser (ex. to instantiate objects of the appropriate class). See the documentation on postprocessors for more information.

Default value: []

allowUnexpectedVersionString

allowUnexpectedVersionString?: boolean;

If true, the version string in a # cDIF directive will not be validated. If false, an error will be thrown if the # cDIF directive's version string is invalid or does not match the cDIF version in use.

Default value: false

Clone this wiki locally