js-yaml - v5.3.0
    Preparing search index...

    Interface MappingTagOptions<Carrier, Result>

    Options for defineMappingTag.

    interface MappingTagOptions<Carrier, Result = Carrier> {
        matchByTagPrefix?: boolean;
        create: (tagName: string) => Carrier;
        addPair: (carrier: Carrier, key: unknown, value: unknown) => string;
        has: (carrier: Carrier, key: unknown) => boolean;
        keys: (result: Result) => Iterable<unknown>;
        get: (result: Result, key: unknown) => unknown;
        finalize?: (carrier: Carrier) => Result;
        identify: (data: any) => boolean;
        represent?: (data: any) => Map<unknown, unknown>;
        representTagName?: (data: any) => string;
    }

    Type Parameters

    Index

    Whether explicit tag names are matched by prefix instead of exact equality. Default: false.

    Create the carrier used while constructing a mapping.

    Writes a pair. Returns '' on success, a non-empty error message otherwise (key does not fit the representation, value rejected, ...). Always a string so the hot path never allocates an exception wrapper.

    Return whether the carrier contains a key, for duplicate and merge checks.

    Return the keys of a completed result for YAML merge processing.

    Return a value from a completed result for YAML merge processing.

    Convert the completed carrier to the result. Defaults to the identity function.

    Selects this tag for a JavaScript value when dumping. Use () => false for load-only tags.

    Return the mapping entries to dump. Defaults to the identity function.

    Return the tag name to emit for a prefix-matching tag. Defaults to tagName.