1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-05 10:18:42 +09:00

Remove unneccesary casts

This commit is contained in:
Aya Morisawa 2018-12-02 19:05:08 +09:00
parent 3a2dc95850
commit 0b6b6a4f2f
No known key found for this signature in database
GPG Key ID: 3E64865D70D579F2

View File

@ -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}`,