Skip to content

Commit

Permalink
fix(TS2322): Type 'unknown' is not assignable to type 'string'.
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaslanjaka committed Feb 14, 2024
1 parent 3c5ee1f commit e1fd7d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/plugins/filter/template_locals/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>;

if (
typeof data !== 'undefined'
Expand Down

0 comments on commit e1fd7d7

Please sign in to comment.