ParseOptions: {
    intAsBigInt?: boolean;
    keepSourceTokens?: boolean;
    lineCounter?: LineCounter;
    prettyErrors?: boolean;
    strict?: boolean;
    uniqueKeys?: boolean | ((a: ParsedNode, b: ParsedNode) => boolean);
}

Type declaration

  • OptionalintAsBigInt?: boolean

    Whether integers should be parsed into BigInt rather than number values.

    Default: false

    https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/BigInt

  • OptionalkeepSourceTokens?: boolean

    Include a srcToken value on each parsed Node, containing the CST token that was composed into this node.

    Default: false

  • OptionallineCounter?: LineCounter

    If set, newlines will be tracked, to allow for lineCounter.linePos(offset) to provide the { line, col } positions within the input.

  • OptionalprettyErrors?: boolean

    Include line/col position & node type directly in parse errors.

    Default: true

  • Optionalstrict?: boolean

    Detect and report errors that are required by the YAML 1.2 spec, but are caused by unambiguous content.

    Default: true

  • OptionaluniqueKeys?: boolean | ((a: ParsedNode, b: ParsedNode) => boolean)

    YAML requires map keys to be unique. By default, this is checked by comparing scalar values with ===; deep equality is not checked for aliases or collections. If merge keys are enabled by the schema, multiple << keys are allowed.

    Set false to disable, or provide your own comparator function to customise. The comparator will be passed two ParsedNode values, and is expected to return a boolean indicating their equality.

    Default: true