From bc844e73c100d12b9efe453b7913b4dedb020ff4 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Wed, 3 Apr 2024 10:15:17 +0900 Subject: [PATCH] chore: update output command --- src/parser/processor.ts | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/parser/processor.ts b/src/parser/processor.ts index 76dbf20a..c9b7a8c9 100644 --- a/src/parser/processor.ts +++ b/src/parser/processor.ts @@ -44,20 +44,24 @@ export class Processor { dump() { const { file } = program.opts(); - const result = JSON.stringify(this._result, (key: string, value: string | number) => { - // Changes "type" to be human-readable - if (key === "type" && typeof value === "number") { - const typeNames: string[] = []; - const types = Object.values(CommentType) as number[]; - types.forEach((typeValue) => { - if (value & typeValue) { - typeNames.push(CommentType[typeValue]); - } - }); - return typeNames.join("|"); - } - return value; - }); + const result = JSON.stringify( + this._result, + (key: string, value: string | number) => { + // Changes "type" to be human-readable + if (key === "type" && typeof value === "number") { + const typeNames: string[] = []; + const types = Object.values(CommentType) as number[]; + types.forEach((typeValue) => { + if (value & typeValue) { + typeNames.push(CommentType[typeValue]); + } + }); + return typeNames.join("|"); + } + return value; + }, + 2 + ); if (!file) { console.log(result); } else {