From 54cfd30276251daf2038cf0976bfe5ecf52dbc54 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Wed, 22 Oct 2025 15:16:07 +0700 Subject: [PATCH 1/2] 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; }; From 1594bc79b5e22c809e686b18669a6ff5a8f13d73 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Wed, 22 Oct 2025 15:17:45 +0700 Subject: [PATCH 2/2] build: update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f404960..26fb4b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Improve count words strategy. + ## [1.12.0] ### Added