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 +5 -4
- package/README.md +5 -4
- package/package.json +1 -1
- package/src/index.js +5 -1
package/README-en.md
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/bahttext)
|
|
4
4
|
[](https://www.npmjs.com/package/bahttext)
|
|
5
5
|
[](http://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://packagephobia.com/result?p=bahttext)
|
|
6
7
|
[](https://github.com/semantic-release/semantic-release) [](https://greenkeeper.io/)
|
|
7
8
|
[](https://codecov.io/github/jojoee/bahttext)
|
|
8
9
|
[](https://dashboard.stryker-mutator.io/reports/github.com/jojoee/bahttext/master)
|
|
9
10
|
|
|
10
|
-
[](https://github.com/jojoee/bahttext/actions/workflows/continuous-integration.yml)
|
|
12
|
+
[](https://github.com/jojoee/bahttext/actions/workflows/release.yml)
|
|
13
|
+
[](https://github.com/jojoee/bahttext/actions/workflows/runnable.yml)
|
|
14
|
+
[](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
|
[](https://www.npmjs.com/package/bahttext)
|
|
4
4
|
[](https://www.npmjs.com/package/bahttext)
|
|
5
5
|
[](http://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://packagephobia.com/result?p=bahttext)
|
|
6
7
|
[](https://github.com/semantic-release/semantic-release) [](https://greenkeeper.io/)
|
|
7
8
|
[](https://codecov.io/github/jojoee/bahttext)
|
|
8
9
|
[](https://dashboard.stryker-mutator.io/reports/github.com/jojoee/bahttext/master)
|
|
9
10
|
|
|
10
|
-
[](https://github.com/jojoee/bahttext/actions/workflows/continuous-integration.yml)
|
|
12
|
+
[](https://github.com/jojoee/bahttext/actions/workflows/release.yml)
|
|
13
|
+
[](https://github.com/jojoee/bahttext/actions/workflows/runnable.yml)
|
|
14
|
+
[](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
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.
|
|
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
|
|