1
0
Fork 1
mirror of https://example.com synced 2024-11-22 11:56:38 +09:00

chore: nyaize -> nyaify

This commit is contained in:
naskya 2024-01-13 15:42:23 +09:00
parent 8a7fd6b593
commit 82869b4022
Signed by: naskya
GPG key ID: 712D413B3A9FED5C
2 changed files with 6 additions and 6 deletions

View file

@ -1,4 +1,4 @@
export function nyaize(
export default function (
text: string,
lang: string | undefined,
appendMiao: boolean,

View file

@ -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);
}