seniority
API reference

seniority/yaml

Every export of seniority/yaml, with its signature and doc comment: parse, YAMLException, plus 1 type.

YAML for configuration files, with no dependency (D-20260930-seniority-yaml).

import { parse, YAMLException } from 'seniority/yaml';

Functions

parse

Read one YAML document into plain values. Throws YAMLException for anything outside the subset above, and for input that is not YAML at all.

function parse(text: string): unknown;
ParameterType
textstring

Returns unknown

Classes

YAMLException

A document this parser cannot read, with the reason and where.

class YAMLException extends Error {
    readonly reason: string;
    readonly mark: Mark | undefined;
    constructor(reason: string, mark?: Mark, snippet?: string);
}

Interfaces

Mark

Where an error is, 0-based, in the shape of js-yaml's mark.

interface Mark {
    line: number;
    column: number;
    position: number;
}

On this page