refactor(backend): 必要ないas anyを消去 (#10293)

This commit is contained in:
Kisaragi 2023-03-11 08:51:37 +09:00 committed by GitHub
parent 65b1524f92
commit 0ac1fc846b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 5 deletions

View file

@ -90,7 +90,7 @@ export class SignupService {
cipher: undefined, cipher: undefined,
passphrase: undefined, passphrase: undefined,
}, },
} as any, (err, publicKey, privateKey) => }, (err, publicKey, privateKey) =>
err ? rej(err) : res([publicKey, privateKey]), err ? rej(err) : res([publicKey, privateKey]),
)); ));

View file

@ -140,7 +140,7 @@ export class ApInboxService {
} else if (isFlag(activity)) { } else if (isFlag(activity)) {
await this.flag(actor, activity); await this.flag(actor, activity);
} else { } else {
this.logger.warn(`unrecognized activity type: ${(activity as any).type}`); this.logger.warn(`unrecognized activity type: ${activity.type}`);
} }
} }

View file

@ -124,7 +124,7 @@ export class ApNoteService {
throw new Error('invalid note'); throw new Error('invalid note');
} }
const note: IPost = object as any; const note = object as IPost;
this.logger.debug(`Note fetched: ${JSON.stringify(note, null, 2)}`); this.logger.debug(`Note fetched: ${JSON.stringify(note, null, 2)}`);

View file

@ -195,7 +195,8 @@ export const isPropertyValue = (object: IObject): object is IApPropertyValue =>
object && object &&
getApType(object) === 'PropertyValue' && getApType(object) === 'PropertyValue' &&
typeof object.name === 'string' && typeof object.name === 'string' &&
typeof (object as any).value === 'string'; 'value' in object &&
typeof object.value === 'string';
export interface IApMention extends IObject { export interface IApMention extends IObject {
type: 'Mention'; type: 'Mention';

View file

@ -64,7 +64,7 @@ export class InboxProcessorService {
const activity = job.data.activity; const activity = job.data.activity;
//#region Log //#region Log
const info = Object.assign({}, activity) as any; const info = Object.assign({}, activity);
delete info['@context']; delete info['@context'];
this.logger.debug(JSON.stringify(info, null, 2)); this.logger.debug(JSON.stringify(info, null, 2));
//#endregion //#endregion