We will be at OWASP APPSEC EUROPE 2017 - Belfast! Let’s talk!MORE INFO

Help Center

Get to know more about our API, Code Annotations and Code Transformations

Whitespace Removal

Potency
0 / 3
Resilience
0 / 5
Cost
0 / 5

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.

Examples

Consider the following example with unnecessary whitespaces:

1
2
3
4
5
6
7
function doesSomething (value) {
var result = 0;
if (value > 2) {
result = value;
}
return result;
}

The transformation removes all unnecessary whitespaces:

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

API Parameters

Example:

1
2
3
4
5
6
7
8
9
10
11
12
{
"keys": {
"accessKey": "XXXXXX",
"secretKey": "YYYYYY"
},
"applicationId": "ZZZZZZ",
"params": [
{
"name": "whitespaceRemoval"
}
]
}