From ccd02c48b311f5b0ca5e7136e723c00578b720b2 Mon Sep 17 00:00:00 2001 From: Jaiwanth Date: Thu, 24 Jun 2021 22:49:36 +0530 Subject: [PATCH] Nicer indentation --- src/utils/exportUtils/JSONExport.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils/exportUtils/JSONExport.ts b/src/utils/exportUtils/JSONExport.ts index 95903bfecd..af62428ae1 100644 --- a/src/utils/exportUtils/JSONExport.ts +++ b/src/utils/exportUtils/JSONExport.ts @@ -28,21 +28,21 @@ export default class JSONExporter extends Exporter { const exporter = this.client.getUserId(); const exporterName = this.room?.getMember(exporter)?.rawDisplayName || exporter; return `{ -"room_name": "${this.room.name}", -"room_creator": "${creatorName}", -"topic": "${topic}", -"export_date": "${exportDate}", -"exported_by": "${exporterName}", -"messages": [ + "room_name": "${this.room.name}", + "room_creator": "${creatorName}", + "topic": "${topic}", + "export_date": "${exportDate}", + "exported_by": "${exporterName}", + "messages": [ ${json} -] + ] }` } protected indentEachLine(string: string) { const indent = ' '; const regex = /^(?!\s*$)/gm; - return string.replace(regex, indent.repeat(1)); + return string.replace(regex, indent.repeat(2)); } protected onBeforeUnload = (e: BeforeUnloadEvent) => {