Skip to content
22 changes: 22 additions & 0 deletions .changeset/gold-guests-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
"vn-number": patch
---

Refactors several functions related to reading and processing digit groups in Vietnamese number words, focusing on code readability, logic simplification, and consistent parameter handling. Minor formatting and code quality improvements are also included, along with updates to development dependencies.

### Refactoring and Code Simplification

* Replaced multi-line if statements with concise ternary expressions in `readFirstGroup` and `readSubsequentGroup` to improve readability in `src/read/three-digits.ts`.
* Simplified the `getDigitWord` function by removing the intermediate variable and returning the mapped value directly in `src/read/digits.ts`.

### Consistent Parameter Handling

* Updated `readHundreds` to use `groupLength` instead of a boolean flag, and made related changes in calls to `readHundreds`, `readTens`, and `readOnes` for more predictable behavior in `src/read/three-digits.ts`. [[1]](diffhunk://#diff-3fec7bfdd409e9017a9411ada902007e8e4e09dfe468f1566e38e002a7b0a521L6-R7) [[2]](diffhunk://#diff-3fec7bfdd409e9017a9411ada902007e8e4e09dfe468f1566e38e002a7b0a521L56-R65)

### Minor Code Quality Improvements

* Added spacing and minor formatting for readability in utility functions such as `allFollowingGroupsAreZero` in `src/read/utils.ts` and `calculateGroupTypes` in `src/read/groups.ts`. [[1]](diffhunk://#diff-3f1a9cf533aed941787f7a40ca3900d359c1da32f1bc1536d2380c3b4968dbb4R26-R31) [[2]](diffhunk://#diff-8c09ad2ec1c3b0524c8cdbfe07826bfc856285b756983a817f609404a880821aR14-R20)

### Dependency Updates

* Updated development dependencies in `package.json`, including `@biomejs/biome`, `syncpack`, and `tsdown` to their latest versions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
"test": "vitest"
},
"devDependencies": {
"@biomejs/biome": "2.3.4",
"@biomejs/biome": "2.3.5",
"@changesets/cli": "2.29.7",
"@codspeed/vitest-plugin": "5.0.1",
"@vitest/coverage-v8": "3.2.4",
"syncpack": "14.0.0-alpha.25",
"tsdown": "0.16.0",
"syncpack": "14.0.0-alpha.26",
"tsdown": "0.16.3",
"typescript": "5.9.3",
"vitest": "3.2.4"
},
Expand Down
Loading