mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-25 09:36:44 -06:00
Remove unneccesary casts
This commit is contained in:
parent
3a2dc95850
commit
0b6b6a4f2f
1 changed files with 2 additions and 2 deletions
|
@ -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 a new issue