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:
parent
3a2dc95850
commit
0b6b6a4f2f
@ -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}`,
|
||||
|
Loading…
Reference in New Issue
Block a user