From ba5929d9d75f59fc84dad89c62b342bc9183d4a3 Mon Sep 17 00:00:00 2001 From: mike Date: Tue, 10 Nov 2020 17:34:24 +0300 Subject: [PATCH] TemplateData in match method shouldnt be required as original version's way (#1) * feat: templateData should be required as original version's way Co-authored-by: EdJoPaTo --- source/i18n.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/i18n.ts b/source/i18n.ts index 73b41fe..135e3d1 100644 --- a/source/i18n.ts +++ b/source/i18n.ts @@ -166,7 +166,7 @@ function compileTemplates(root: Readonly>): RepositoryEnt /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */ -export function match(resourceKey: string, templateData: Readonly): (text: string, ctx: TelegrafContextWithI18n) => string[] | null { +export function match(resourceKey: string, templateData?: Readonly): (text: string, ctx: TelegrafContextWithI18n) => string[] | null { return (text, ctx) => (text && ctx?.i18n && text === ctx.i18n.t(resourceKey, templateData)) ? [text] : null }