bahttext 2.3.2 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README-en.md CHANGED
@@ -3,14 +3,15 @@
3
3
  [![Version - npm](https://img.shields.io/npm/v/bahttext.svg)](https://www.npmjs.com/package/bahttext)
4
4
  [![Download - npm](https://img.shields.io/npm/dt/bahttext.svg)](https://www.npmjs.com/package/bahttext)
5
5
  [![License - npm](https://img.shields.io/npm/l/bahttext.svg)](http://opensource.org/licenses/MIT)
6
+ [![install size](https://packagephobia.com/badge?p=bahttext)](https://packagephobia.com/result?p=bahttext)
6
7
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release) [![Greenkeeper badge](https://badges.greenkeeper.io/jojoee/bahttext.svg)](https://greenkeeper.io/)
7
8
  [![Codecov](https://img.shields.io/codecov/c/github/jojoee/bahttext.svg)](https://codecov.io/github/jojoee/bahttext)
8
9
  [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fjojoee%2Fbahttext%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/jojoee/bahttext/master)
9
10
 
10
- [![continuous integration](https://github.com/jojoee/bahttext/workflows/continuous%20integration/badge.svg?branch=master)](https://github.com/jojoee/bahttext/actions/workflows/continuous-integration.yml)
11
- [![release](https://github.com/jojoee/bahttext/workflows/release/badge.svg?branch=master)](https://github.com/jojoee/bahttext/actions/workflows/release.yml)
12
- [![runnable](https://github.com/jojoee/bahttext/workflows/runnable/badge.svg?branch=master)](https://github.com/jojoee/bahttext/actions/workflows/runnable.yml)
13
- [![runnable old node](https://github.com/jojoee/bahttext/workflows/runnable%20old%20node/badge.svg?branch=master)](https://github.com/jojoee/bahttext/actions/workflows/runnable-old-node.yml)
11
+ [![continuous-integration](https://github.com/jojoee/bahttext/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/jojoee/bahttext/actions/workflows/continuous-integration.yml)
12
+ [![release](https://github.com/jojoee/bahttext/actions/workflows/release.yml/badge.svg)](https://github.com/jojoee/bahttext/actions/workflows/release.yml)
13
+ [![runnable](https://github.com/jojoee/bahttext/actions/workflows/runnable.yml/badge.svg)](https://github.com/jojoee/bahttext/actions/workflows/runnable.yml)
14
+ [![runnable-old-node](https://github.com/jojoee/bahttext/actions/workflows/runnable-old-node.yml/badge.svg)](https://github.com/jojoee/bahttext/actions/workflows/runnable-old-node.yml)
14
15
 
15
16
  Only `TH` and `EN` languages are maintained, the rest is auto-generated by ChatGPT API. Language:
16
17
  [ไทย](https://github.com/jojoee/bahttext/blob/master/README.md),
package/README.md CHANGED
@@ -3,14 +3,15 @@
3
3
  [![Version - npm](https://img.shields.io/npm/v/bahttext.svg)](https://www.npmjs.com/package/bahttext)
4
4
  [![Download - npm](https://img.shields.io/npm/dt/bahttext.svg)](https://www.npmjs.com/package/bahttext)
5
5
  [![License - npm](https://img.shields.io/npm/l/bahttext.svg)](http://opensource.org/licenses/MIT)
6
+ [![install size](https://packagephobia.com/badge?p=bahttext)](https://packagephobia.com/result?p=bahttext)
6
7
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release) [![Greenkeeper badge](https://badges.greenkeeper.io/jojoee/bahttext.svg)](https://greenkeeper.io/)
7
8
  [![Codecov](https://img.shields.io/codecov/c/github/jojoee/bahttext.svg)](https://codecov.io/github/jojoee/bahttext)
8
9
  [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fjojoee%2Fbahttext%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/jojoee/bahttext/master)
9
10
 
10
- [![continuous integration](https://github.com/jojoee/bahttext/workflows/continuous%20integration/badge.svg?branch=master)](https://github.com/jojoee/bahttext/actions/workflows/continuous-integration.yml)
11
- [![release](https://github.com/jojoee/bahttext/workflows/release/badge.svg?branch=master)](https://github.com/jojoee/bahttext/actions/workflows/release.yml)
12
- [![runnable](https://github.com/jojoee/bahttext/workflows/runnable/badge.svg?branch=master)](https://github.com/jojoee/bahttext/actions/workflows/runnable.yml)
13
- [![runnable old node](https://github.com/jojoee/bahttext/workflows/runnable%20old%20node/badge.svg?branch=master)](https://github.com/jojoee/bahttext/actions/workflows/runnable-old-node.yml)
11
+ [![continuous-integration](https://github.com/jojoee/bahttext/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/jojoee/bahttext/actions/workflows/continuous-integration.yml)
12
+ [![release](https://github.com/jojoee/bahttext/actions/workflows/release.yml/badge.svg)](https://github.com/jojoee/bahttext/actions/workflows/release.yml)
13
+ [![runnable](https://github.com/jojoee/bahttext/actions/workflows/runnable.yml/badge.svg)](https://github.com/jojoee/bahttext/actions/workflows/runnable.yml)
14
+ [![runnable-old-node](https://github.com/jojoee/bahttext/actions/workflows/runnable-old-node.yml/badge.svg)](https://github.com/jojoee/bahttext/actions/workflows/runnable-old-node.yml)
14
15
 
15
16
  Only `TH` and `EN` languages are maintained, the rest is auto-generated by ChatGPT API. Language:
16
17
  [ไทย](https://github.com/jojoee/bahttext/blob/master/README.md),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bahttext",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "Change number to Thai pronunciation string",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
package/src/index.js CHANGED
@@ -16,7 +16,11 @@ const TENS = [
16
16
  ...[EMPTY, YEE, ...THREE_TO_NINE].map(t => t + DIGIT[1]) // "สิบ" family
17
17
  ]
18
18
  // 0-99 lookup (fast satang conversion)
19
- const SUB_HUNDRED = TENS.flatMap(t => ONES.map(o => t + o))
19
+ const SUB_HUNDRED = TENS.reduce(
20
+ (acc, t) => acc.concat(ONES.map(o => t + o)),
21
+ []
22
+ )
23
+
20
24
  // Special case: 1 should read "หนึ่ง" not "เอ็ด"
21
25
  SUB_HUNDRED[1] = ONE
22
26