Skip to content

Commit

Permalink
chore(View.data): cast to return type of hexo-front-matter
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaslanjaka committed May 17, 2023
1 parent 73a066a commit 3611783
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/theme/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ class View {
public path: any;
public source: any;
public _theme: any;
public data: any;
public data: ReturnType<typeof yfm>;
public _compiled: any;
public _compiledSync: any;
public _helper: any;
public _render: any;
public layout: any;
public _content: any;

constructor(path: string, data) {
constructor(path: string, data: string | ReturnType<typeof yfm>) {
this.path = path;
this.source = join(this._theme.base, 'layout', path);
this.data = typeof data === 'string' ? yfm(data, {}) : data;
Expand Down

0 comments on commit 3611783

Please sign in to comment.