Skip to content

Commit

Permalink
chore(i18nLocalsFilter): cast data to any
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaslanjaka committed Oct 6, 2024
1 parent 61f224a commit a35ed54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/plugins/filter/template_locals/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ function i18nLocalsFilter(this: Hexo, locals: LocalsType): void {

if (!lang) {
const pattern = new Pattern(`${i18nDir}/*path`);
const data = pattern.match(locals.path) as Record<string, any>;
const data = pattern.match(locals.path) as any;

if (data && typeof data.lang === 'string' && i18nLanguages.includes(data.lang)) {
if (data && 'lang' in data && i18nLanguages.includes(data.lang)) {
lang = data.lang;
page.canonical_path = data.path;
} else {
Expand Down

0 comments on commit a35ed54

Please sign in to comment.