Skip to content

Commit

Permalink
perf(router): avoid calling set when the generated data unmodified
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin committed Apr 28, 2024
1 parent cc8c520 commit d59ff95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/hexo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,10 @@ class Hexo extends EventEmitter {
const { data, layout } = generatorResult;

if (!layout) {
route.set(path, data);
// @ts-ignore

Check failure on line 629 in lib/hexo/index.ts

View workflow job for this annotation

GitHub Actions / linter

Do not use "@ts-ignore" because it alters compilation errors
if (data.modified == null || data.modified) {
route.set(path, data);
}
return path;
}

Expand Down

0 comments on commit d59ff95

Please sign in to comment.