From 9b1d56285b353120d4c7685f970c2ab3f299ab98 Mon Sep 17 00:00:00 2001 From: yuyinws Date: Fri, 8 Mar 2024 13:23:49 +0800 Subject: [PATCH] fix: escaped unicode symbols error --- src/core/transform/common.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/transform/common.ts b/src/core/transform/common.ts index 04480b7..ae7d445 100644 --- a/src/core/transform/common.ts +++ b/src/core/transform/common.ts @@ -17,6 +17,14 @@ export function genConsoleString(genContext: GenContext) { const fileName = getExtendedPath(filePath, extendedPathFileNames) const fileType = extname(filePath) + // Parsing escaped unicode symbols + try { + argsName = JSON.parse(`"${argsName}"`) + } + catch (error) { + + } + if (argsName?.length > 30) argsName = `${argsName.slice(0, 30)}...`