From 5facd11592dbd2bb789aeaa9082ca8edd35f373a Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Feb 2023 11:02:37 +0900 Subject: [PATCH] refactor: fix types --- packages/backend/src/core/QueryService.ts | 6 +++--- packages/backend/src/misc/gen-identicon.ts | 2 +- packages/backend/src/server/ActivityPubServerService.ts | 1 + packages/backend/src/server/api/SignupApiService.ts | 1 + packages/backend/src/server/web/ClientServerService.ts | 3 +++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/core/QueryService.ts b/packages/backend/src/core/QueryService.ts index 4cc844ccea..c334d749e6 100644 --- a/packages/backend/src/core/QueryService.ts +++ b/packages/backend/src/core/QueryService.ts @@ -1,10 +1,10 @@ import { Inject, Injectable } from '@nestjs/common'; -import { Brackets } from 'typeorm'; +import { Brackets, ObjectLiteral } from 'typeorm'; import { DI } from '@/di-symbols.js'; import type { User } from '@/models/entities/User.js'; import type { UserProfilesRepository, FollowingsRepository, ChannelFollowingsRepository, MutedNotesRepository, BlockingsRepository, NoteThreadMutingsRepository, MutingsRepository } from '@/models/index.js'; -import type { SelectQueryBuilder } from 'typeorm'; import { bindThis } from '@/decorators.js'; +import type { SelectQueryBuilder } from 'typeorm'; @Injectable() export class QueryService { @@ -32,7 +32,7 @@ export class QueryService { ) { } - public makePaginationQuery(q: SelectQueryBuilder, sinceId?: string, untilId?: string, sinceDate?: number, untilDate?: number): SelectQueryBuilder { + public makePaginationQuery(q: SelectQueryBuilder, sinceId?: string, untilId?: string, sinceDate?: number, untilDate?: number): SelectQueryBuilder { if (sinceId && untilId) { q.andWhere(`${q.alias}.id > :sinceId`, { sinceId: sinceId }); q.andWhere(`${q.alias}.id < :untilId`, { untilId: untilId }); diff --git a/packages/backend/src/misc/gen-identicon.ts b/packages/backend/src/misc/gen-identicon.ts index 4a70d7a4bb..b40745973e 100644 --- a/packages/backend/src/misc/gen-identicon.ts +++ b/packages/backend/src/misc/gen-identicon.ts @@ -51,7 +51,7 @@ export function genIdenticon(seed: string, stream: WriteStream): Promise { bg.addColorStop(0, bgColors[0]); bg.addColorStop(1, bgColors[1]); - ctx.fillStyle = bg; + ctx.fillStyle = bg as any; ctx.beginPath(); ctx.fillRect(0, 0, size, size); diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts index 632a2ccb2e..186d3822d8 100644 --- a/packages/backend/src/server/ActivityPubServerService.ts +++ b/packages/backend/src/server/ActivityPubServerService.ts @@ -540,6 +540,7 @@ export class ActivityPubServerService { return (this.apRendererService.renderActivity(this.apRendererService.renderKey(user, keypair))); } else { reply.code(400); + return; } }); diff --git a/packages/backend/src/server/api/SignupApiService.ts b/packages/backend/src/server/api/SignupApiService.ts index c46f71d934..ffd7e203ea 100644 --- a/packages/backend/src/server/api/SignupApiService.ts +++ b/packages/backend/src/server/api/SignupApiService.ts @@ -146,6 +146,7 @@ export class SignupApiService { `To complete signup, please click this link: ${link}`); reply.code(204); + return; } else { try { const { account, secret } = await this.signupService.signup({ diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 044cba8d1e..1fa8950d75 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -372,6 +372,7 @@ export class ClientServerService { return feed.atom1(); } else { reply.code(404); + return; } }); @@ -384,6 +385,7 @@ export class ClientServerService { return feed.rss2(); } else { reply.code(404); + return; } }); @@ -396,6 +398,7 @@ export class ClientServerService { return feed.json1(); } else { reply.code(404); + return; } });