Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
TemplateData in match method shouldnt be required as original version…
Browse files Browse the repository at this point in the history
…'s way (#1)

* feat: templateData should be required as original version's way

Co-authored-by: EdJoPaTo <github@edjopato.de>
  • Loading branch information
jfkz and EdJoPaTo authored Nov 10, 2020
1 parent d1e0368 commit ba5929d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function compileTemplates(root: Readonly<Record<string, string>>): RepositoryEnt

/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */

export function match(resourceKey: string, templateData: Readonly<TemplateData>): (text: string, ctx: TelegrafContextWithI18n) => string[] | null {
export function match(resourceKey: string, templateData?: Readonly<TemplateData>): (text: string, ctx: TelegrafContextWithI18n) => string[] | null {
return (text, ctx) => (text && ctx?.i18n && text === ctx.i18n.t(resourceKey, templateData)) ? [text] : null
}

Expand Down

0 comments on commit ba5929d

Please sign in to comment.