diff --git a/packages/backend/src/misc/nyaize.ts b/packages/backend/src/misc/nyaify.ts similarity index 97% rename from packages/backend/src/misc/nyaize.ts rename to packages/backend/src/misc/nyaify.ts index d9d5c346..efeac12d 100644 --- a/packages/backend/src/misc/nyaize.ts +++ b/packages/backend/src/misc/nyaify.ts @@ -1,4 +1,4 @@ -export function nyaize( +export default function ( text: string, lang: string | undefined, appendMiao: boolean, diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index 0a61eae8..ef9871bc 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -12,7 +12,7 @@ import { Channels, } from "../index.js"; import type { Packed } from "@/misc/schema.js"; -import { nyaize } from "@/misc/nyaize.js"; +import nyaify from "@/misc/nyaify.js"; import { awaitAll } from "@/prelude/await-all.js"; import { convertReactions, decodeReaction } from "@/misc/reaction-lib.js"; import type { NoteReaction } from "@/models/entities/note-reaction.js"; @@ -277,10 +277,10 @@ export const NoteRepository = db.getRepository(Note).extend({ if (packed.user.isCat && packed.user.speakAsCat && packed.text != null) { const tokens = packed.text ? mfm.parse(packed.text) : []; - function nyaizeNode(node: mfm.MfmNode) { + function nyaifyNode(node: mfm.MfmNode) { if (node.type === "quote") return; if (node.type === "text") - node.props.text = nyaize( + node.props.text = nyaify( node.props.text, packed.lang, shouldAppendMiao, @@ -288,12 +288,12 @@ export const NoteRepository = db.getRepository(Note).extend({ if (node.children) { for (const child of node.children) { - nyaizeNode(child); + nyaifyNode(child); } } } - for (const node of tokens) nyaizeNode(node); + for (const node of tokens) nyaifyNode(node); packed.text = mfm.toString(tokens); }