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

x/iso639_1/src/narrowers.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/src/narrowers.ts";

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.