From 7b05dadba253c2826531d3ece2de1736a86392e2 Mon Sep 17 00:00:00 2001 From: CoderSerio <2779066456@qq.com> Date: Fri, 31 May 2024 14:51:35 +0800 Subject: [PATCH] fix(utils): unable to start on Windows11 --- tools/base64-data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/base64-data.ts b/tools/base64-data.ts index 8a1419c3..0a1ad7d5 100644 --- a/tools/base64-data.ts +++ b/tools/base64-data.ts @@ -24,7 +24,7 @@ const reduceDir = (dirPath: string, paths: string[] = []) => { if (statSync(filePath).isDirectory()) { reduceDir(filePath, [...paths, file]); } else if (/^base64\.[\s\S]+\.[\s\S]+$/.test(file) && file !== OUT_FILE) { - table.write([filePath.match(/(?<=packages\/)[\s\S]+?(?=\/)/)![0], file]); + table.write([(filePath.match(/(?<=packages\/)[\s\S]+?(?=\/)/) as string[])?.[0], file]); const bitmap = readFileSync(filePath, { encoding: 'base64' }); output += String.raw` '${file.match(/(?<=\.)[\s\S]+(?=\.)/)![0]}': '${bitmap}', `;