@metreeca/blue - v0.12.0
    Preparing search index...

    Type Alias StringConstraints<V, P>

    StringConstraints: StringLengthConstraints & StringValueConstraints<V> & {
        datatype?: Reference;
        pattern?: P;
    }

    Constraints accepted by the string shape factory.

    Adds the RDF datatype and the lexical pattern, which only the general-purpose factory accepts, to the length and value constraints shared with the specialised factories.

    Type Parameters

    • V extends string = string

      The values the enumeration admits

    • P extends string | RegExp = string | RegExp

      The form a pattern takes: a regular expression or its source where one is stated, the source alone on a built shape

    Type Declaration

    • Optional Readonlydatatype?: Reference

      RDF datatype IRI for the textual literal.

      States the RDF datatype of validated JSON values, which carry none of their own.

      Inheritance — must be strictly equal when both parent and child define it; otherwise the single defined value carries through. A mismatch is reported as an error.

      undefined (falls back to xsd:string)

    • Optional Readonlypattern?: P

      Regular expression pattern that values must match.

      The pattern is matched without anchoring: the constraint holds when the pattern occurs anywhere within the value. Use anchors (^ and $) to require a match against the complete string.

      Inheritance — must be strictly equal when both parent and child define it; otherwise the single defined value carries through. Within a union, this equality makes pattern a discriminator: two same-datatype string variants that differ only by pattern are distinct branches.

      undefined (no pattern constraint)