chore: formatting

This commit is contained in:
ThatOneCalculator 2023-02-04 12:41:25 -08:00
parent 26570158fd
commit 4bd399f321
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
3 changed files with 7 additions and 6 deletions

View File

@ -2,9 +2,9 @@ export function nyaize(text: string): string {
return ( return (
text text
// ja-JP // ja-JP
.replace(/な/g, "にゃ") .replaceAll("な", "にゃ")
.replace(/ナ/g, "ニャ") .replaceAll("ナ", "ニャ")
.replace(/ナ/g, "ニャ") .replaceAll("ナ", "ニャ")
// en-US // en-US
.replace(/(?<=n)a/gi, (x) => (x === "A" ? "YA" : "ya")) .replace(/(?<=n)a/gi, (x) => (x === "A" ? "YA" : "ya"))
.replace(/(?<=morn)ing/gi, (x) => (x === "ING" ? "YAN" : "yan")) .replace(/(?<=morn)ing/gi, (x) => (x === "ING" ? "YAN" : "yan"))

View File

@ -93,7 +93,7 @@ export default define(meta, paramDef, async (ps, me) => {
try { try {
if (ps.tag) { if (ps.tag) {
if (!safeForSql(normalizeForSearch(ps.tag))) throw 'Injection'; if (!safeForSql(normalizeForSearch(ps.tag))) throw "Injection";
query.andWhere(`'{"${normalizeForSearch(ps.tag)}"}' <@ note.tags`); query.andWhere(`'{"${normalizeForSearch(ps.tag)}"}' <@ note.tags`);
} else { } else {
query.andWhere( query.andWhere(
@ -102,7 +102,8 @@ export default define(meta, paramDef, async (ps, me) => {
qb.orWhere( qb.orWhere(
new Brackets((qb) => { new Brackets((qb) => {
for (const tag of tags) { for (const tag of tags) {
if (!safeForSql(normalizeForSearch(ps.tag))) throw 'Injection'; if (!safeForSql(normalizeForSearch(ps.tag)))
throw "Injection";
qb.andWhere(`'{"${normalizeForSearch(tag)}"}' <@ note.tags`); qb.andWhere(`'{"${normalizeForSearch(tag)}"}' <@ note.tags`);
} }
}), }),

View File

@ -316,7 +316,7 @@ function done(query?: any): boolean | void {
if (query == null) query = q.value; if (query == null) query = q.value;
if (query == null || typeof query !== 'string') return; if (query == null || typeof query !== 'string') return;
const q2 = query.replace(/:/g, ''); const q2 = query.replaceAll(':', '');
const exactMatchCustom = customEmojis.find(emoji => emoji.name === q2); const exactMatchCustom = customEmojis.find(emoji => emoji.name === q2);
if (exactMatchCustom) { if (exactMatchCustom) {
chosen(exactMatchCustom); chosen(exactMatchCustom);