From 01b81d29e92f455c66480fb73c024ba434ce0d72 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Sat, 27 Apr 2024 09:10:59 +0800 Subject: [PATCH] improve syntax formatting --- scripts/utils/net.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/utils/net.js b/scripts/utils/net.js index 818adac..95d69c7 100644 --- a/scripts/utils/net.js +++ b/scripts/utils/net.js @@ -24,20 +24,20 @@ export default class net { if (CONNECT.ok && !VERIFY_ONLY) { DATA = await CONNECT.text(); - if ( - TYPE - ? TYPE.toLowerCase().includes(`json`) || TYPE.toLowerCase().includes(`dictionary`) - : false - ) { + if (TYPE + ? (TYPE.toLowerCase().includes(`json`) || TYPE.toLowerCase().includes(`dictionary`)) + : false) { try { - DATA = JSON.parse(DATA); - // When not in JSON, run this. + DATA = JSON.parse(DATA); } catch(err) { + // When not in JSON, run this. if (STRICT) { // Should not allow the data to be returned since it's not correct. DATA = null; throw new TypeError(texts.localized(`error_msg_notJSON`, false)); - } else {logging.warn(texts.localized(`error_msg_notJSON`, false));} + } else { + logging.warn(texts.localized(`error_msg_notJSON`, false)); + } }; }; }