From 657a91362eded1ea9a5d157e2e49e0f175565640 Mon Sep 17 00:00:00 2001 From: Jee <36779802+985563349@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:44:21 +0800 Subject: [PATCH] chore: optimize sort gradient non-numeric judgments (#51720) Co-authored-by: lijianan <574980606@qq.com> --- components/progress/Line.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/progress/Line.tsx b/components/progress/Line.tsx index a59d4e4d85..e37e5c03b3 100644 --- a/components/progress/Line.tsx +++ b/components/progress/Line.tsx @@ -34,7 +34,7 @@ export const sortGradient = (gradients: StringGradients) => { let tempArr: { key: number; value?: string }[] = []; Object.keys(gradients).forEach((key) => { const formattedKey = parseFloat(key.replace(/%/g, '')); - if (!isNaN(formattedKey)) { + if (!Number.isNaN(formattedKey)) { tempArr.push({ key: formattedKey, value: gradients[key] }); } });