feat: カスタム絵文字エクスポート

This commit is contained in:
syuilo
2021-12-10 18:24:26 +09:00
parent 0b038f6477
commit bd903cdbb5
10 changed files with 298 additions and 5 deletions

View File

@ -74,7 +74,8 @@ export async function exportNotes(job: Bull.Job<DbUserJobData>, done: any): Prom
}
const content = JSON.stringify(serialize(note, poll));
await new Promise<void>((res, rej) => {
stream.write(exportedNotesCount === 0 ? content : ',\n' + content, err => {
const isFirst = exportedNotesCount === 0;
stream.write(isFirst ? content : ',\n' + content, err => {
if (err) {
logger.error(err);
rej(err);