1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 13:10:17 +00:00

add missing docs

This commit is contained in:
✨ Audrey ✨
2025-04-21 13:33:32 -04:00
parent b0ed145a14
commit d547c3f7ea

View File

@@ -20,10 +20,14 @@ export function deepFreeze<T extends object>(value: T): Readonly<T> {
return Object.freeze(value);
}
/** Type guard that returns `true` when the value is an i18n key. */
export function isI18nKey(value: I18nKeyOrLiteral): value is string {
return typeof value === "string";
}
export function isLiteral(value: I18nKeyOrLiteral): value is string {
/** Type guard that returns `true` when the value requires no translation.
* @remarks the literal value can be accessed using the `.literal` property.
*/
export function isLiteral(value: I18nKeyOrLiteral): value is { literal: string } {
return typeof value === "object" && "literal" in value;
}