Skip to content

Commit

Permalink
use @ts-expect-error for avoiding compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin committed Feb 28, 2023
1 parent 9aef503 commit ca12570
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/plugins/generator/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ interface Data {
}

const process = (name, ctx) => {
// @ts-expect-error
return Promise.filter(ctx.model(name).toArray(), (asset: warehouse['Schema']) => fs.exists(asset.source).tap(exist => {
// @ts-expect-error
if (!exist) return asset.remove();
})).map((asset: warehouse['Schema']) => {
// @ts-expect-error
const { source } = asset;
// @ts-expect-error
let { path } = asset;
const data: Data = {
// @ts-expect-error
modified: asset.modified
};

// @ts-expect-error
if (asset.renderable && ctx.render.isRenderable(path)) {
// Replace extension name if the asset is renderable
const filename = path.substring(0, path.length - extname(path).length);
Expand Down

0 comments on commit ca12570

Please sign in to comment.