This commit is contained in:
mike12345567 2021-01-25 17:08:38 +00:00
parent ebb78a3c29
commit 01f9885637
2 changed files with 7 additions and 3 deletions

View File

@ -41,7 +41,8 @@ module.exports.processors = [
new Preprocessor(PreprocessorNames.FIX_FUNCTIONS, statement => { new Preprocessor(PreprocessorNames.FIX_FUNCTIONS, statement => {
for (let specialCase of FUNCTION_CASES) { for (let specialCase of FUNCTION_CASES) {
const toFind = `{ ${specialCase}`, replacement = `{${specialCase}` const toFind = `{ ${specialCase}`,
replacement = `{${specialCase}`
statement = statement.replace(new RegExp(toFind, "g"), replacement) statement = statement.replace(new RegExp(toFind, "g"), replacement)
} }
return statement return statement

View File

@ -13,7 +13,10 @@ module.exports.swapStrings = (string, start, length, swap) => {
// removes null and undefined // removes null and undefined
module.exports.removeNull = obj => { 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)) { for (let [key, value] of Object.entries(obj)) {
// only objects // only objects
if (typeof value === "object" && !Array.isArray(value)) { if (typeof value === "object" && !Array.isArray(value)) {
@ -25,7 +28,7 @@ module.exports.removeNull = obj => {
module.exports.addConstants = obj => { module.exports.addConstants = obj => {
if (obj.now == null) { if (obj.now == null) {
obj.now = (new Date()).toISOString() obj.now = new Date().toISOString()
} }
return obj return obj
} }