From e0ee48040b9be43bd31f7215dfe63793aa990ee0 Mon Sep 17 00:00:00 2001 From: yoshinorin Date: Thu, 16 Feb 2023 23:18:44 +0900 Subject: [PATCH] use `any` for avoiding compile error --- lib/extend/tag.ts | 2 +- lib/hexo/index.ts | 2 +- lib/plugins/console/deploy.ts | 2 +- lib/plugins/filter/before_generate/render_post.ts | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/extend/tag.ts b/lib/extend/tag.ts index da7844fb7d..8757de6b70 100644 --- a/lib/extend/tag.ts +++ b/lib/extend/tag.ts @@ -54,7 +54,7 @@ class NunjucksTag { return this._run(context, args, ''); } - _run(context, args, body) { + _run(context, args, body): any { return Reflect.apply(this.fn, context.ctx, [args, body]); } } diff --git a/lib/hexo/index.ts b/lib/hexo/index.ts index ae61e38217..302747f178 100644 --- a/lib/hexo/index.ts +++ b/lib/hexo/index.ts @@ -327,7 +327,7 @@ class Hexo extends EventEmitter { const c = this.extend.console.get(name); - if (c) return Reflect.apply(c, this, [args]).asCallback(callback); + if (c) return (Reflect.apply(c, this, [args]) as any).asCallback(callback); return Promise.reject(new Error(`Console \`${name}\` has not been registered yet!`)); } diff --git a/lib/plugins/console/deploy.ts b/lib/plugins/console/deploy.ts index 1f9504f235..b443b7c155 100644 --- a/lib/plugins/console/deploy.ts +++ b/lib/plugins/console/deploy.ts @@ -48,7 +48,7 @@ function deployConsole(args) { this.log.info('Deploying: %s', magenta(type)); - return Reflect.apply(deployers[type], this, [{ ...item, ...args }]).then(() => { + return (Reflect.apply(deployers[type], this, [{ ...item, ...args }]) as any).then(() => { this.log.info('Deploy done: %s', magenta(type)); }); }).then(() => { diff --git a/lib/plugins/filter/before_generate/render_post.ts b/lib/plugins/filter/before_generate/render_post.ts index b747e6f287..ae202e9477 100644 --- a/lib/plugins/filter/before_generate/render_post.ts +++ b/lib/plugins/filter/before_generate/render_post.ts @@ -1,11 +1,10 @@ import Promise from 'bluebird'; -import warehouse from 'warehouse'; function renderPostFilter(data) { const renderPosts = model => { const posts = model.toArray().filter(post => post.content == null); - return Promise.map(posts, (post: warehouse.Schema) => { + return Promise.map(posts, (post: any) => { post.content = post._content; post.site = {data};