hackmud-script-manager 0.20.4-75a0f8e → 0.20.4-7caccd9
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/hsm.js +1 -1
- package/env.d.ts +638 -1288
- package/package.json +1 -1
- package/processScript/minify.js +7 -5
package/package.json
CHANGED
package/processScript/minify.js
CHANGED
@@ -220,8 +220,10 @@ async function minify(file, { uniqueId = "00000000000", mangleNames = !1, forceQ
|
|
220
220
|
)
|
221
221
|
},
|
222
222
|
StringLiteral(path) {
|
223
|
-
path.node.value
|
224
|
-
|
223
|
+
if (JSON.stringify(path.node.value).includes("\\u00") || path.toString().length < 4) {
|
224
|
+
path.node.value = replaceUnsafeStrings(uniqueId, path.node.value)
|
225
|
+
return
|
226
|
+
}
|
225
227
|
"key" == path.parentKey && "ObjectProperty" == path.parent.type && (path.parent.computed = !0)
|
226
228
|
let jsonValueIndex = jsonValues.indexOf(path.node.value)
|
227
229
|
;-1 == jsonValueIndex && (jsonValueIndex += jsonValues.push(path.node.value))
|
@@ -244,7 +246,7 @@ async function minify(file, { uniqueId = "00000000000", mangleNames = !1, forceQ
|
|
244
246
|
})
|
245
247
|
await Promise.all(promises)
|
246
248
|
const functionDeclaration = file.program.body[0]
|
247
|
-
assert("FunctionDeclaration" == functionDeclaration.type, "src/processScript/minify.ts:
|
249
|
+
assert("FunctionDeclaration" == functionDeclaration.type, "src/processScript/minify.ts:364:61")
|
248
250
|
if (jsonValues.length) {
|
249
251
|
hasComment = !0
|
250
252
|
if (1 == jsonValues.length)
|
@@ -361,7 +363,7 @@ async function minify(file, { uniqueId = "00000000000", mangleNames = !1, forceQ
|
|
361
363
|
)
|
362
364
|
}
|
363
365
|
if (1 == forceQuineCheats) return code
|
364
|
-
assert(scriptBeforeJSONValueReplacement, "src/processScript/minify.ts:
|
366
|
+
assert(scriptBeforeJSONValueReplacement, "src/processScript/minify.ts:495:43")
|
365
367
|
return (
|
366
368
|
countHackmudCharacters(scriptBeforeJSONValueReplacement) <=
|
367
369
|
countHackmudCharacters(code) + Number(hasComment)
|
@@ -377,7 +379,7 @@ function parseObjectExpression(node, o) {
|
|
377
379
|
"Identifier" == property.key.type ||
|
378
380
|
"NumericLiteral" == property.key.type ||
|
379
381
|
"StringLiteral" == property.key.type,
|
380
|
-
"src/processScript/minify.ts:
|
382
|
+
"src/processScript/minify.ts:517:4"
|
381
383
|
)
|
382
384
|
if ("ArrayExpression" == property.value.type) {
|
383
385
|
const childArray = []
|