From 01f9885637dd1617b603181af65dfa68390dccc3 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 25 Jan 2021 17:08:38 +0000 Subject: [PATCH] Linting. --- packages/string-templates/src/processors/preprocessor.js | 3 ++- packages/string-templates/src/utilities.js | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/string-templates/src/processors/preprocessor.js b/packages/string-templates/src/processors/preprocessor.js index 8c2f9f7c56..af6d656eaa 100644 --- a/packages/string-templates/src/processors/preprocessor.js +++ b/packages/string-templates/src/processors/preprocessor.js @@ -41,7 +41,8 @@ module.exports.processors = [ new Preprocessor(PreprocessorNames.FIX_FUNCTIONS, statement => { for (let specialCase of FUNCTION_CASES) { - const toFind = `{ ${specialCase}`, replacement = `{${specialCase}` + const toFind = `{ ${specialCase}`, + replacement = `{${specialCase}` statement = statement.replace(new RegExp(toFind, "g"), replacement) } return statement diff --git a/packages/string-templates/src/utilities.js b/packages/string-templates/src/utilities.js index 45064b9a8b..1f88db9d41 100644 --- a/packages/string-templates/src/utilities.js +++ b/packages/string-templates/src/utilities.js @@ -13,7 +13,10 @@ module.exports.swapStrings = (string, start, length, swap) => { // removes null and undefined module.exports.removeNull = obj => { - obj = _(obj).omitBy(_.isUndefined).omitBy(_.isNull).value() + obj = _(obj) + .omitBy(_.isUndefined) + .omitBy(_.isNull) + .value() for (let [key, value] of Object.entries(obj)) { // only objects if (typeof value === "object" && !Array.isArray(value)) { @@ -25,7 +28,7 @@ module.exports.removeNull = obj => { module.exports.addConstants = obj => { if (obj.now == null) { - obj.now = (new Date()).toISOString() + obj.now = new Date().toISOString() } return obj }