@aleksejdix/ally-bcp47
Version:
TypeScript package for working with BCP-47 language tags
13 lines (12 loc) • 454 B
TypeScript
import { LanguageTag, ValidationError } from "../types/index.js";
/**
* Parses a language tag string into its component parts
* This implements the core parsing functionality according to RFC 5646
*
* @param tag The language tag to parse
* @returns An object representing the parsed language tag, or null if parsing fails
*/
export declare function parseLanguageTag(tag: string): {
parsed: LanguageTag | null;
errors: ValidationError[];
};