mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
https://github.com/javascript-obfuscator/javascript-obfuscator/issues/610 Co-authored-by: sanex3339 <yarabotayuvyandex3339>
13 lines
330 B
TypeScript
13 lines
330 B
TypeScript
/**
|
|
* Adds some spaces between some language constructions
|
|
*
|
|
* @param {string} code
|
|
* @returns {string}
|
|
*/
|
|
export function beautifyCode (code: string): string {
|
|
return code
|
|
.replace(/function\(\){/g, 'function () {')
|
|
.replace(/(!?=+)/g, ' $1 ')
|
|
.replace(/,/g, ', ')
|
|
.replace(/;/g, '; ');
|
|
} |