What it changes
Replaces runtime string literals with calls to a generated decoder backed by an obfuscated string vault.Before and after
Configuration
Run this transform by settingtransforms.concealStrings to true or an options object:
obfuscate.mjs
{ cache, cover, scope } instead of true. The string pool is shared by the whole program. Program scope is the default and uses one vault. Function scope gives each function its own closure-backed vault, created every time the function definition is evaluated. Its cache survives later calls and is never shared with other functions. Equal strings share one entry within their vault. The default regional cover fills U+0000-00FF plus every 256-unit page touched anywhere in the program. Use used for compact output or full for all 65,536 UTF-16 units. Disable cache to decode on every evaluation.
View the implementation
Open the TypeScript implementation on GitHub.
Read the behavior tests
Review behavior checks and cases this transform leaves alone.