Skip to content

Commit

Permalink
no longer breaks scripts that are already using quine cheats - this i…
Browse files Browse the repository at this point in the history
…s done by replacing calls to `scripts.quine` (`#` not `$`) with a string containing the source code to the script (before minification)
  • Loading branch information
samualtnorman committed Jul 25, 2021
1 parent d3437ce commit 8a176b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ export async function processScript(script: string) {
const semicolons = script.match(/;/g)?.length ?? 0

script = script
.replace(/#[fhmln43210]s\.scripts\.quine\(\)/g, JSON.stringify(script))
.replace(/[#$][fhmln43210]?s\.([a-z_][a-z_0-9]{0,24})\.([a-z_][a-z_0-9]{0,24})\(/g, "SC$$$1$$$2(")
.replace(/^function\s*\(/, "function script(")
.replace(/#D\(/g, "$D(")
Expand Down

0 comments on commit 8a176b5

Please sign in to comment.