kill `as any` for ApMfmService

This commit is contained in:
Kisaragi Marine 2024-06-21 03:52:13 +09:00
parent 1c5e04199e
commit 30abfac7b4
No known key found for this signature in database
GPG Key ID: C6631564CD2110E4
2 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@ export class ApMfmService {
}
@bindThis
public getNoteHtml(note: MiNote, apAppend?: string) {
public getNoteHtml(note: Pick<MiNote, 'text' | 'mentionedRemoteUsers'>, apAppend?: string) {
let noMisskeyContent = false;
const srcMfm = (note.text ?? '') + (apAppend ?? '');

View File

@ -23,10 +23,10 @@ describe('ApMfmService', () => {
describe('getNoteHtml', () => {
test('Do not provide _misskey_content for simple text', () => {
const note: MiNote = {
const note = {
text: 'テキスト #タグ @mention 🍊 :emoji: https://example.com',
mentionedRemoteUsers: '[]',
} as any;
};
const { content, noMisskeyContent } = apMfmService.getNoteHtml(note);
@ -35,10 +35,10 @@ describe('ApMfmService', () => {
});
test('Provide _misskey_content for MFM', () => {
const note: MiNote = {
const note = {
text: '$[tada foo]',
mentionedRemoteUsers: '[]',
} as any;
};
const { content, noMisskeyContent } = apMfmService.getNoteHtml(note);