From d547c3f7ea28f99dc98d339ddd61ab6c8174ed0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=20Audrey=20=E2=9C=A8?= Date: Mon, 21 Apr 2025 13:33:32 -0400 Subject: [PATCH] add missing docs --- libs/common/src/tools/util.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/common/src/tools/util.ts b/libs/common/src/tools/util.ts index e8292ec5b1a..0fcb5a972af 100644 --- a/libs/common/src/tools/util.ts +++ b/libs/common/src/tools/util.ts @@ -20,10 +20,14 @@ export function deepFreeze(value: T): Readonly { 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; }