UNPKG

@inlang/paraglide-js

Version:

[![NPM Downloads](https://img.shields.io/npm/dw/%40inlang%2Fparaglide-js?logo=npm&logoColor=red&label=npm%20downloads)](https://www.npmjs.com/package/@inlang/paraglide-js) [![GitHub Issues](https://img.shields.io/github/issues-closed/opral/paraglide-js?lo

32 lines 981 B
/** * Coerces a locale-like string to the canonical locale value used by the runtime. * * @param {unknown} value * @returns {Locale | undefined} */ export declare function toLocale(value: unknown): Locale | undefined; /** * Check if something is an available locale with the canonical project casing. * * @example * if (isLocale(params.locale)) { * setLocale(params.locale); * } else { * setLocale('en'); * } * * Use `toLocale()` when you want case-insensitive matching and canonicalization. * * @param {unknown} locale * @returns {locale is Locale} */ export declare function isLocale(locale: unknown): locale is Locale; /** * Asserts that the input can be normalized to a locale. * * @param {unknown} input - The input to check. * @returns {Locale} The input normalized to a Locale. * @throws {Error} If the input is not a locale. */ export declare function assertIsLocale(input: unknown): Locale; //# sourceMappingURL=check-locale.d.ts.map