diff --git a/src/core/operations/JSONBeautify.mjs b/src/core/operations/JSONBeautify.mjs index 83af32e..a2b2dfd 100644 --- a/src/core/operations/JSONBeautify.mjs +++ b/src/core/operations/JSONBeautify.mjs @@ -28,7 +28,7 @@ class JSONBeautify extends Operation { { "name": "Indent string", "type": "binaryShortString", - "value": "\\t" + "value": " " }, { "name": "Sort Object Keys", @@ -44,8 +44,8 @@ class JSONBeautify extends Operation { * @returns {string} */ run(input, args) { - const indentStr = args[0]; - const sortBool = args[1]; + const [indentStr, sortBool] = args; + if (!input) return ""; if (sortBool) { input = JSON.stringify(JSONBeautify._sort(JSON.parse(input))); diff --git a/test/tests/operations/JSONBeautify.mjs b/test/tests/operations/JSONBeautify.mjs index 3042731..5a89bd9 100644 --- a/test/tests/operations/JSONBeautify.mjs +++ b/test/tests/operations/JSONBeautify.mjs @@ -3,7 +3,7 @@ * * @author Phillip Nordwall [Phillip.Nordwall@gmail.com] * - * @copyright Crown Copyright 2017 + * @copyright Crown Copyright 2018 * @license Apache-2.0 */ import TestRegister from "../../TestRegister"; diff --git a/test/tests/operations/JSONMinify.mjs b/test/tests/operations/JSONMinify.mjs index 4bbccf8..4feefab 100644 --- a/test/tests/operations/JSONMinify.mjs +++ b/test/tests/operations/JSONMinify.mjs @@ -3,7 +3,7 @@ * * @author Phillip Nordwall [Phillip.Nordwall@gmail.com] * - * @copyright Crown Copyright 2017 + * @copyright Crown Copyright 2018 * @license Apache-2.0 */ import TestRegister from "../../TestRegister";