From 8ce5a878996813e2d47f47d386e549e621f730fe Mon Sep 17 00:00:00 2001 From: Nixinova Date: Wed, 28 Jun 2023 17:41:42 +1200 Subject: [PATCH] Fix mistake in minifying cached data files --- build/download-files.ts | 2 +- changelog.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build/download-files.ts b/build/download-files.ts index 825a0cb..2f7de4b 100644 --- a/build/download-files.ts +++ b/build/download-files.ts @@ -11,7 +11,7 @@ async function writeFile(filename: string) { const fileDataMin = fileData // Convert /x flag .replace(/(\s+|^)#.*/g, '') // remove comments - .replace(/: \|.*\n((\s+).+\n(\2.+\n)+)/g, (_, content) => `: '${content.replace(/^\s+|\s+$|\r?\n/gm, '')}'\n`) // flatten multi-line data + .replace(/(pattern: )\|.*\n((\s+).+\n(\2.+\n)+)/g, (_, pref, content) => `${pref}'${content.replace(/^\s+|\s+$|\r?\n/gm, '')}'\n`) // flatten multi-line data .replace('(?x)', '') fs.promises.writeFile(filePath, fileDataMin) .then(() => console.log(`Successfully wrote ${filename}.`)) diff --git a/changelog.md b/changelog.md index 71a7184..7935af9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # Changelog +## Next +- Fixed cached data files having formatting issues. + ## 2.5.5 *2023-06-25* - Fixed a crash occurring when parsing heuristics with negative inline PCRE flags.