Skip to content

Commit c3fcbec

Browse files
author
sanex3339
committed
Added examples to the simplify option in README.md
1 parent 6f27dc6 commit c3fcbec

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,35 @@ Type: `boolean` Default: `true`
780780

781781
Enables additional code obfuscation through simplification.
782782

783-
##### :warning: in the future releases obfuscation of `boolean` literals (`true` => `!![]`) will be moved under this option.
783+
##### :warning: in future releases obfuscation of `boolean` literals (`true` => `!![]`) will be moved under this option.
784+
785+
Example:
786+
```ts
787+
// input
788+
if (condition1) {
789+
const foo = 1;
790+
const bar = 2;
791+
792+
console.log(foo);
793+
794+
return bar;
795+
} else if (condition2) {
796+
console.log(1);
797+
console.log(2);
798+
console.log(3);
799+
800+
return 4;
801+
} else {
802+
return 5;
803+
}
804+
805+
// output
806+
if (condition1) {
807+
const foo = 0x1, bar = 0x2;
808+
return console['log'](foo), bar;
809+
} else
810+
return condition2 ? (console['log'](0x1), console['log'](0x2), console['log'](0x3), 0x4) : 0x5;
811+
```
784812

785813
### `sourceMap`
786814
Type: `boolean` Default: `false`

0 commit comments

Comments
 (0)