From 4264704ce81f6ad7cef4530851ec7d3191a87e70 Mon Sep 17 00:00:00 2001 From: Tben Date: Sun, 13 Aug 2023 12:02:58 +0100 Subject: [PATCH] Upgrades --- engine/engine/utils/parseDbResults.js | 6 ++---- functions/decrypt.js | 1 + package.json | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/engine/engine/utils/parseDbResults.js b/engine/engine/utils/parseDbResults.js index e30482b..6b4608c 100644 --- a/engine/engine/utils/parseDbResults.js +++ b/engine/engine/utils/parseDbResults.js @@ -53,10 +53,8 @@ module.exports = async function parseDbResults({ unparsedResults, tableSchema }) continue; } - if (resultFieldSchema?.encrypted) { - if (value?.match(/./)) { - result[resultFieldName] = decrypt({ encryptedString: value, encryptionKey, encryptionSalt }); - } + if (resultFieldSchema?.encrypted && value?.match(/./)) { + result[resultFieldName] = decrypt({ encryptedString: value, encryptionKey, encryptionSalt }); } } diff --git a/functions/decrypt.js b/functions/decrypt.js index 971116c..7627cef 100644 --- a/functions/decrypt.js +++ b/functions/decrypt.js @@ -4,6 +4,7 @@ const { Buffer } = require("buffer"); const decrypt = ({ encryptedString, encryptionKey, encryptionSalt }) => { if (!encryptedString?.match(/.}/)) { console.log("Encrypted string is invalid"); + console.log("Encrypted string =>", encryptedString); return data; } diff --git a/package.json b/package.json index 5738ab9..54edb6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "1.6.5", + "version": "1.6.6", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {