@metreeca/core - v0.10.0
    Preparing search index...

    Function isTag

    • Checks if a value is a valid language tag.

      Validates language tags according to BCP 47/RFC 5646 § 2.1, excluding grandfathered tags. A language tag is a sequence of subtags identifying a natural language, for example en, fr-CA or zh-Hans-CN; case is not significant, so EN-us is accepted alongside en-US.

      Parameters

      • value: unknown

        The value to validate as a language tag

      Returns value is string

      true if value is a well-formed language tag; false otherwise

      Tag