Whitespace Removal

Potency n/a
Resilience n/a
Cost n/a
Tags: newline, whitespace, optimization, minifcation, removal, elimination

Description

Some whitespace are not necessary for JavaScript parsing. Removing those from the code will reduce the file size, resulting in quicker download times and reduced bandwidth consumption.

Note: This transformation cannot be enabled or disabled using annotations. To enable it, add it to the protection configuration parameters.

Examples

Consider the following example with unnecessary whitespaces:

function doesSomething (value) {
  var result = 0;
  if (value > 2) {
    result = value;
  }
  return result;
}

The transformation removes all unnecessary whitespaces:

function doesSomething(value){var result=0;if(value>2){result=value;}return result;}

API Parameters

Example:

{
  "keys": {
    "accessKey": "XXXXXX",
    "secretKey": "YYYYYY"
  },
  "applicationId": "ZZZZZZ",
  "params": [
    {
      "name": "whitespaceRemoval"
    }
  ]
}