From 0b6b6a4f2f48875acdf712f5abc8f7ca88cefecf Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sun, 2 Dec 2018 19:05:08 +0900 Subject: [PATCH] Remove unneccesary casts --- src/server/web/docs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/web/docs.ts b/src/server/web/docs.ts index b535a236dd..9cc54cdf0b 100644 --- a/src/server/web/docs.ts +++ b/src/server/web/docs.ts @@ -30,7 +30,7 @@ async function genVars(lang: string): Promise<{ [key: string]: any }> { const entities = glob.sync('src/docs/api/entities/**/*.yaml', { cwd }); vars['entities'] = entities.map(x => { - const _x = yaml.safeLoad(fs.readFileSync(cwd + x, 'utf-8')) as any; + const _x = yaml.safeLoad(fs.readFileSync(cwd + x, 'utf-8')); return _x.name; }); @@ -197,7 +197,7 @@ router.get('/*/api/entities/*', async ctx => { const lang = ctx.params[0]; const entity = ctx.params[1]; - const x = yaml.safeLoad(fs.readFileSync(path.resolve(`${__dirname}/../../../src/docs/api/entities/${entity}.yaml`), 'utf-8')) as any; + const x = yaml.safeLoad(fs.readFileSync(path.resolve(`${__dirname}/../../../src/docs/api/entities/${entity}.yaml`), 'utf-8')); await ctx.render('../../../../src/docs/api/entities/view', Object.assign(await genVars(lang), { id: `api/entities/${entity}`,