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

    Interface ScalarTagDefinition<Result>

    Normalized scalar tag returned by defineScalarTag.

    interface ScalarTagDefinition<Result = unknown> {
        implicit: boolean;
        matchByTagPrefix: boolean;
        implicitFirstChars: readonly string[] | null;
        resolve: (
            source: string,
            isExplicit: boolean,
            tagName: string,
        ) => typeof NOT_RESOLVED | Result;
        identify: (data: any) => boolean;
        represent: (data: any) => string;
        representTagName: (data: any) => string;
        tagName: string;
        nodeKind: "scalar";
    }

    Type Parameters

    • Result = unknown

    Hierarchy

    Index

    Whether this tag participates in resolving plain scalars without an explicit tag. Default: false.

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

    Set of source.charAt(0) keys for which resolve may succeed (a superset of what it really matches). A key is either a single character or '' (empty source). null means "no constraint, always try". Used by the composer to dispatch implicit scalars by first character without running every resolver.

    Construct a value from scalar text, or return NOT_RESOLVED when it is invalid for this tag. isExplicit is true for an explicit tag and tagName is the actual matched name.

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

    A scalar's printed form is text, so represent always yields a string. The factory supplies a String(data) default when a tag omits it.

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

    Tag name used for schema lookup.

    YAML node kind handled by this tag.