From: Jérôme Benoit Date: Fri, 23 Oct 2020 11:54:42 +0000 (+0200) Subject: Cleanups. X-Git-Tag: v1.0.1-0~247 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=67e9cccf0987accd6faacf4e70d9416d0da5d7d5;p=e-mobility-charging-stations-simulator.git Cleanups. Signed-off-by: Jérôme Benoit --- diff --git a/src/utils/Utils.js b/src/utils/Utils.js index bd8c8036..3009ae56 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -15,26 +15,6 @@ class Utils { return date.toISOString().substr(11, 8); } - static isIterable(obj) { - if (obj) { - return typeof obj[Symbol.iterator] === 'function'; - } - return false; - } - - static isEmptyJSon(document) { - // Empty? - if (!document) { - return true; - } - // Check type - if (typeof document !== 'object') { - return true; - } - // Check - return Object.keys(document).length === 0; - } - static removeExtraEmptyLines(tab) { // Start from the end for (let i = tab.length - 1; i > 0; i--) { @@ -157,6 +137,26 @@ class Utils { return JSON.parse(JSON.stringify(jsonDocument)); } + static isIterable(obj) { + if (obj) { + return typeof obj[Symbol.iterator] === 'function'; + } + return false; + } + + static isEmptyJSon(document) { + // Empty? + if (!document) { + return true; + } + // Check type + if (typeof document !== 'object') { + return true; + } + // Check + return Object.keys(document).length === 0; + } + static isString(value) { return typeof value === 'string'; }