Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/iso639_1/mod.ts

Type-safe ISO 639-1 language code (a.k.a. two-letter codes) for TypeScript
Latest
import * as iso6391 from "https://deno.land/x/iso639_1@1.2.20090901/mod.ts";

Classes

Error thrown when a language code is invalid.

Variables

The authoritative labels of all valid language codes. In the first dimension, the object is indexed by the language code. In the second dimension, the object is indexed by the authoritative label language. In the third dimension, the array consists of the authoritative labels of the language code in the authoritative label language.

The array of all valid language codes. This array contains only the two-letter language codes defined in ISO 3166-1 with lower case.

The date when the data were last updated. In other words, this date means the version of the data. Note that the time part of this object is mostly meaningless.

Functions

A predicate function to narrow down the string type to the LanguageCode type if the given string is a valid language code.

Parses the given string as a language code. If the given string is not a valid language code, null is returned.

Asserts that the given string is a valid language code. If the given string is not a valid language code, an InvalidLanguageCodeError is thrown.

Type Aliases

The string literal type of all valid authoritative label language codes. This type is a subset of LanguageCode type.

The string literal type of all valid language codes. This type contains only the two-letter language codes defined in ISO 3166-1 with lower case.