From a8d4a35eb87a3f7454085d40c2a464ba89063d97 Mon Sep 17 00:00:00 2001 From: mrfry Date: Mon, 21 Feb 2022 20:41:29 +0100 Subject: [PATCH] Create json script update --- src/standaloneUtils/createJSON.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/standaloneUtils/createJSON.js b/src/standaloneUtils/createJSON.js index a141409..81329c0 100644 --- a/src/standaloneUtils/createJSON.js +++ b/src/standaloneUtils/createJSON.js @@ -6,6 +6,8 @@ const file = params[2] const data = fs.readFileSync(file,'utf8').split('\n') console.log(data) +console.log("TODO: remove 'Q: ' and 'A: '") + let currVal = {} const res = data.reduce((acc, val) => { const formattedVal = val.replace(/\r/g, '').trim() @@ -21,7 +23,12 @@ const res = data.reduce((acc, val) => { currVal.A = formattedVal return [ ...acc, - currVal + { + ...currVal, + data: { + type: 'simple' + } + } ] }