[Scripts > Strip] Minify static bools

main
CanadaHonk 2 years ago committed by GitHub
parent 47fa7e40f3
commit fd5b7ba4ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,6 +22,8 @@ const stripCode = (code) => code
.replaceAll('throw ', 'throw#')
.replaceAll('async ', 'async#')
.replaceAll('else ', 'else#')
.replaceAll('false', '!!0')
.replaceAll('true', '!0')
.replace(/((['"`])[\s\S]*?\2)|[ \n]/g, (_, g1) => g1 || '')
.replaceAll('#', ' ')
.replaceAll('? ?', '??');

Loading…
Cancel
Save