From 54cfd30276251daf2038cf0976bfe5ecf52dbc54 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Wed, 22 Oct 2025 15:16:07 +0700 Subject: [PATCH] fix: improve count words strategy --- src/molecules/Input/helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/molecules/Input/helper.ts b/src/molecules/Input/helper.ts index 29a4930..1f9bfb7 100644 --- a/src/molecules/Input/helper.ts +++ b/src/molecules/Input/helper.ts @@ -8,6 +8,6 @@ * /> */ export const countWordsStrategy = (value: string): number => { - const words = value.split(' '); + const words = value.trim().split(/\s+/).filter(Boolean); return words.length; };