From b71a889f528905d1bf449cefb30f4d1755a17b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=AB=E9=9B=A8=E6=B0=B4=E8=BF=87=E6=BB=A4=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E6=B0=94-Rain?= <958414905@qq.com> Date: Fri, 10 Nov 2023 14:39:19 +0800 Subject: [PATCH] refactor(compiler-dom): use String's built-in repeat method (#6700) --- .../__tests__/transforms/stringifyStatic.spec.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts b/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts index 85efeafb8..90eb25c72 100644 --- a/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts +++ b/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts @@ -20,10 +20,7 @@ describe('stringify static html', () => { } function repeat(code: string, n: number): string { - return new Array(n) - .fill(0) - .map(() => code) - .join('') + return code.repeat(n) } test('should bail on non-eligible static trees', () => {