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

    Function dictionary

    • Creates a dictionary shape.

      Contradictory constraints are rejected as the shape is built, so a shape that exists admits at least one value.

      Type Parameters

      Parameters

      Returns DictionaryConstraints & { kind: "dictionary" } & { uniqueLang: C["uniqueLang"] }

      An immutable shape admitting the language maps the constraints bound, carrying a single string per tag where they state uniqueLang

      • Readonlykind: "dictionary"

        Discriminator identifying this as a dictionary shape.

        Inheritance — cannot be overridden.

      • ReadonlyuniqueLang: C["uniqueLang"]

        Restricts every tag to a single string, exactly as stated.

        Carries the constraint at the value it was given rather than at the whole boolean domain, so that the content of a tag is typed at the arity the shape admits.

      TraceError Where the stated constraints contradict one another

      const label = required(dictionary({ uniqueLang: true }));
      const description = optional(dictionary({ languageIn: ["en", "it"] }));
      const keywords = multiple(dictionary({ languageIn: ["en"] }));