From 58f1df3288b0f9584bb413dd34b8d65671258f6f Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Fri, 15 Nov 2024 15:56:46 +0800 Subject: [PATCH] refactor: first character judgment replacement regexp (#18658) --- packages/vite/rollupLicensePlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/rollupLicensePlugin.ts b/packages/vite/rollupLicensePlugin.ts index 03cd9272a197db..831883988713fa 100644 --- a/packages/vite/rollupLicensePlugin.ts +++ b/packages/vite/rollupLicensePlugin.ts @@ -127,7 +127,7 @@ function sortLicenses(licenses: Set) { let withParenthesis: string[] = [] let noParenthesis: string[] = [] licenses.forEach((license) => { - if (/^\(/.test(license)) { + if (license[0] === '(') { withParenthesis.push(license) } else { noParenthesis.push(license)