json_minify

melakuka minifikasi pada json body

Created by: ayyubnoezher
Installed 2 times

Category: Utils

Created on: Monday, February 10, 2025 at 8:31:56 AM

Updated on: Friday, February 21, 2025 at 5:04:00 PM

Tag arguments
[
   {
      "type": "string",
      "help": "This provides help on the argument",
      "defaultValue": "test"
   },
   {
      "type": "number",
      "help": "This provides help on the argument",
      "defaultValue": "0xff"
   },
   {
      "type": "quotelessString",
      "help": "This provides help on the argument",
      "defaultValue": "encode"
   },
   {
      "type": "boolean",
      "help": "This provides help on the argument",
      "defaultValue": "false"
   }
]
Code
try {
  var jsonBody = input;
  var parsed = JSON.parse(jsonBody); // Parse JSON
  var minified = JSON.stringify(parsed); // Minify JSON
  output = minified;
} catch (e) {
  output = "Invalid JSON!";
}