Skip to content

Commit 04c51cd

Browse files
committed
fixed db and subscript over mutiple lines
1 parent 57b61d3 commit 04c51cd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ export async function minifyScript(script: string) {
241241
// preprocessing
242242
script = script
243243
.replace(/function(?: \w+| )?\(/, `function script_${uid}(`)
244-
.replace(/#([fhmln0-4]s|db|G|FMCL|D)/g, a => a.replace("#", `_hash_${uid}_`))
244+
.replace(/#([fhmln0-4]s|db|G|FMCL|D)\.[\w\.]+\(/g, a => a.replace("#", `_hash_${uid}_`).replace(/\./g, `_dot_${uid}_`))
245245

246246
// compilation
247247
script = transpileModule(script, {
@@ -280,6 +280,7 @@ export async function minifyScript(script: string) {
280280
script = script
281281
.replace(`script_${uid}`, "")
282282
.replace(new RegExp(`_hash_${uid}_`, "g"), "#")
283+
.replace(new RegExp(`_dot_${uid}_`, "g"), ".")
283284

284285
if (autocompleteMatch)
285286
return script.replace(/function \(.*\) \{/, `$& // ${(autocompleteMatch[1] || autocompleteMatch[2]).trim()}`)

0 commit comments

Comments
 (0)