From a6c66e3278630afb8bd41b4e6fe62af5cb625abf Mon Sep 17 00:00:00 2001 From: "Dylan R. E. Moonfire" Date: Wed, 3 Feb 2021 22:58:39 -0600 Subject: [PATCH] refactor: code cleanup --- src/tools/content.ts | 3 ++- src/tools/extract.ts | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tools/content.ts b/src/tools/content.ts index 6393949..87917c3 100644 --- a/src/tools/content.ts +++ b/src/tools/content.ts @@ -34,7 +34,8 @@ export function handler(argv: any) if (argv.output === "-") { console.log(output); - } else { + } else + { fs.writeFileSync(argv.output, Buffer.from(output, "utf-8")); } } diff --git a/src/tools/extract.ts b/src/tools/extract.ts index 9aa4e78..132dcc1 100644 --- a/src/tools/extract.ts +++ b/src/tools/extract.ts @@ -62,10 +62,11 @@ export function handler(argv: any) } else if (argv.content !== "__content") { // Rename the content property. - data.forEach(x => { + data.forEach(x => + { x[argv.content] = x.__content; delete x.__content; - }) + }); } // Determine if we are displaying a list of items. If we want a list, then @@ -84,7 +85,8 @@ export function handler(argv: any) if (argv.output === "-") { console.log(output); - } else { + } else + { fs.writeFileSync(argv.output, Buffer.from(output, "utf-8")); } }