diff --git a/lib/plugins/filter/template_locals/i18n.ts b/lib/plugins/filter/template_locals/i18n.ts index 520fbfbcad..76feaa2c43 100644 --- a/lib/plugins/filter/template_locals/i18n.ts +++ b/lib/plugins/filter/template_locals/i18n.ts @@ -13,7 +13,9 @@ function i18nLocalsFilter(this: Hexo, locals: LocalsType): void { if (!lang) { const pattern = new Pattern(`${i18nDir}/*path`); - const data = pattern.match(locals.path); + // fix hexo-util/dist/pattern.d.ts is not object + // fix(TS2322): Type 'unknown' is not assignable to type 'string'. + const data = pattern.match(locals.path) as Record; if ( typeof data !== 'undefined'