We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 77dd2cd commit 529d4a6Copy full SHA for 529d4a6
1 file changed
src/core.js
@@ -388,11 +388,11 @@ export async function compress(input, options) {
388
if (typeof JUSTCstr != 'undefined' && JUSTCstr.length < str.length && str == JSON.stringify(obj)) {
389
str = JUSTCstr;
390
code3 = 1;
391
- } else {
+ } else if (str.startsWith('{') && str.endsWith('}')) {
392
str = str.slice(1,-1);
393
code3 = 5;
394
}
395
- } else if (typeof obj == 'object' && Array.isArray(obj)) {
+ } else if (typeof obj == 'object' && Array.isArray(obj) && str.startsWith('[') && str.endsWith(']')) {
396
/* JSON Array (as string) */
397
398
code3 = 3;
0 commit comments