kill `as any` for ApMfmService
This commit is contained in:
parent
1c5e04199e
commit
30abfac7b4
|
@ -25,7 +25,7 @@ export class ApMfmService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public getNoteHtml(note: MiNote, apAppend?: string) {
|
public getNoteHtml(note: Pick<MiNote, 'text' | 'mentionedRemoteUsers'>, apAppend?: string) {
|
||||||
let noMisskeyContent = false;
|
let noMisskeyContent = false;
|
||||||
const srcMfm = (note.text ?? '') + (apAppend ?? '');
|
const srcMfm = (note.text ?? '') + (apAppend ?? '');
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,10 @@ describe('ApMfmService', () => {
|
||||||
|
|
||||||
describe('getNoteHtml', () => {
|
describe('getNoteHtml', () => {
|
||||||
test('Do not provide _misskey_content for simple text', () => {
|
test('Do not provide _misskey_content for simple text', () => {
|
||||||
const note: MiNote = {
|
const note = {
|
||||||
text: 'テキスト #タグ @mention 🍊 :emoji: https://example.com',
|
text: 'テキスト #タグ @mention 🍊 :emoji: https://example.com',
|
||||||
mentionedRemoteUsers: '[]',
|
mentionedRemoteUsers: '[]',
|
||||||
} as any;
|
};
|
||||||
|
|
||||||
const { content, noMisskeyContent } = apMfmService.getNoteHtml(note);
|
const { content, noMisskeyContent } = apMfmService.getNoteHtml(note);
|
||||||
|
|
||||||
|
@ -35,10 +35,10 @@ describe('ApMfmService', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Provide _misskey_content for MFM', () => {
|
test('Provide _misskey_content for MFM', () => {
|
||||||
const note: MiNote = {
|
const note = {
|
||||||
text: '$[tada foo]',
|
text: '$[tada foo]',
|
||||||
mentionedRemoteUsers: '[]',
|
mentionedRemoteUsers: '[]',
|
||||||
} as any;
|
};
|
||||||
|
|
||||||
const { content, noMisskeyContent } = apMfmService.getNoteHtml(note);
|
const { content, noMisskeyContent } = apMfmService.getNoteHtml(note);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue