From 917a2e59ce45dafcc78cc77edd617298a637d972 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sun, 6 Oct 2019 03:10:20 +0200 Subject: [PATCH] Fix compacting large json files --- src/util/helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/helper.py b/src/util/helper.py index 8e0f285f..317c5eed 100644 --- a/src/util/helper.py +++ b/src/util/helper.py @@ -49,7 +49,7 @@ def jsonDumps(data): else: return match.group(0) - content = re.sub(r"\{(\n[^,\[\{]{10,100}?)\}[, ]{0,2}\n", compact_dict, content, flags=re.DOTALL) + content = re.sub(r"\{(\n[^,\[\{]{10,100000}?)\}[, ]{0,2}\n", compact_dict, content, flags=re.DOTALL) def compact_list(match): if "\n" in match.group(0): @@ -58,7 +58,7 @@ def jsonDumps(data): else: return match.group(0) - content = re.sub(r"\[([^\[\{]{2,300}?)\][, ]{0,2}\n", compact_list, content, flags=re.DOTALL) + content = re.sub(r"\[([^\[\{]{2,100000}?)\][, ]{0,2}\n", compact_list, content, flags=re.DOTALL) # Remove end of line whitespace content = re.sub(r"(?m)[ ]+$", "", content)