n2words 2.0.0 → 3.0.0
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/CHANGELOG.md +49 -0
- package/README.md +86 -188
- package/dist/languages/am-Latn.js +3 -0
- package/dist/languages/am-Latn.js.map +1 -0
- package/dist/languages/am.js +3 -0
- package/dist/languages/am.js.map +1 -0
- package/dist/languages/ar.js +3 -0
- package/dist/languages/ar.js.map +1 -0
- package/dist/languages/az.js +3 -0
- package/dist/languages/az.js.map +1 -0
- package/dist/languages/bn.js +3 -0
- package/dist/languages/bn.js.map +1 -0
- package/dist/languages/cs.js +3 -0
- package/dist/languages/cs.js.map +1 -0
- package/dist/languages/da.js +3 -0
- package/dist/languages/da.js.map +1 -0
- package/dist/languages/de.js +3 -0
- package/dist/languages/de.js.map +1 -0
- package/dist/languages/el.js +3 -0
- package/dist/languages/el.js.map +1 -0
- package/dist/languages/en.js +3 -0
- package/dist/languages/en.js.map +1 -0
- package/dist/languages/es.js +3 -0
- package/dist/languages/es.js.map +1 -0
- package/dist/languages/fa.js +3 -0
- package/dist/languages/fa.js.map +1 -0
- package/dist/languages/fi.js +3 -0
- package/dist/languages/fi.js.map +1 -0
- package/dist/languages/fil.js +3 -0
- package/dist/languages/fil.js.map +1 -0
- package/dist/languages/fr-BE.js +3 -0
- package/dist/languages/fr-BE.js.map +1 -0
- package/dist/languages/fr.js +3 -0
- package/dist/languages/fr.js.map +1 -0
- package/dist/languages/gu.js +3 -0
- package/dist/languages/gu.js.map +1 -0
- package/dist/languages/ha.js +3 -0
- package/dist/languages/ha.js.map +1 -0
- package/dist/languages/hbo.js +3 -0
- package/dist/languages/hbo.js.map +1 -0
- package/dist/languages/he.js +3 -0
- package/dist/languages/he.js.map +1 -0
- package/dist/languages/hi.js +3 -0
- package/dist/languages/hi.js.map +1 -0
- package/dist/languages/hr.js +3 -0
- package/dist/languages/hr.js.map +1 -0
- package/dist/languages/hu.js +3 -0
- package/dist/languages/hu.js.map +1 -0
- package/dist/languages/id.js +3 -0
- package/dist/languages/id.js.map +1 -0
- package/dist/languages/it.js +3 -0
- package/dist/languages/it.js.map +1 -0
- package/dist/languages/ja.js +3 -0
- package/dist/languages/ja.js.map +1 -0
- package/dist/languages/kn.js +3 -0
- package/dist/languages/kn.js.map +1 -0
- package/dist/languages/ko.js +3 -0
- package/dist/languages/ko.js.map +1 -0
- package/dist/languages/lt.js +3 -0
- package/dist/languages/lt.js.map +1 -0
- package/dist/languages/lv.js +3 -0
- package/dist/languages/lv.js.map +1 -0
- package/dist/languages/mr.js +3 -0
- package/dist/languages/mr.js.map +1 -0
- package/dist/languages/ms.js +3 -0
- package/dist/languages/ms.js.map +1 -0
- package/dist/languages/nb.js +3 -0
- package/dist/languages/nb.js.map +1 -0
- package/dist/languages/nl.js +3 -0
- package/dist/languages/nl.js.map +1 -0
- package/dist/languages/pa.js +3 -0
- package/dist/languages/pa.js.map +1 -0
- package/dist/languages/pl.js +3 -0
- package/dist/languages/pl.js.map +1 -0
- package/dist/languages/pt.js +3 -0
- package/dist/languages/pt.js.map +1 -0
- package/dist/languages/ro.js +3 -0
- package/dist/languages/ro.js.map +1 -0
- package/dist/languages/ru.js +3 -0
- package/dist/languages/ru.js.map +1 -0
- package/dist/languages/sr-Cyrl.js +3 -0
- package/dist/languages/sr-Cyrl.js.map +1 -0
- package/dist/languages/sr-Latn.js +3 -0
- package/dist/languages/sr-Latn.js.map +1 -0
- package/dist/languages/sv.js +3 -0
- package/dist/languages/sv.js.map +1 -0
- package/dist/languages/sw.js +3 -0
- package/dist/languages/sw.js.map +1 -0
- package/dist/languages/ta.js +3 -0
- package/dist/languages/ta.js.map +1 -0
- package/dist/languages/te.js +3 -0
- package/dist/languages/te.js.map +1 -0
- package/dist/languages/th.js +3 -0
- package/dist/languages/th.js.map +1 -0
- package/dist/languages/tr.js +3 -0
- package/dist/languages/tr.js.map +1 -0
- package/dist/languages/uk.js +3 -0
- package/dist/languages/uk.js.map +1 -0
- package/dist/languages/ur.js +3 -0
- package/dist/languages/ur.js.map +1 -0
- package/dist/languages/vi.js +3 -0
- package/dist/languages/vi.js.map +1 -0
- package/dist/languages/zh-Hans.js +3 -0
- package/dist/languages/zh-Hans.js.map +1 -0
- package/dist/languages/zh-Hant.js +3 -0
- package/dist/languages/zh-Hant.js.map +1 -0
- package/dist/n2words.js +2 -2
- package/dist/n2words.js.map +1 -1
- package/lib/languages/am-Latn.d.ts +7 -0
- package/lib/languages/am-Latn.js +164 -0
- package/lib/languages/am.d.ts +7 -0
- package/lib/languages/am.js +164 -0
- package/lib/languages/ar.d.ts +14 -27
- package/lib/languages/ar.js +175 -129
- package/lib/languages/az.d.ts +4 -9
- package/lib/languages/az.js +171 -37
- package/lib/languages/bn.d.ts +4 -8
- package/lib/languages/bn.js +138 -124
- package/lib/languages/cs.d.ts +15 -85
- package/lib/languages/cs.js +310 -114
- package/lib/languages/da.d.ts +11 -12
- package/lib/languages/da.js +276 -101
- package/lib/languages/de.d.ts +14 -11
- package/lib/languages/de.js +317 -86
- package/lib/languages/el.d.ts +11 -11
- package/lib/languages/el.js +231 -78
- package/lib/languages/en.d.ts +14 -13
- package/lib/languages/en.js +242 -72
- package/lib/languages/es.d.ts +18 -12
- package/lib/languages/es.js +317 -103
- package/lib/languages/fa.d.ts +4 -44
- package/lib/languages/fa.js +112 -122
- package/lib/languages/fi.d.ts +14 -0
- package/lib/languages/fi.js +245 -0
- package/lib/languages/fil.d.ts +4 -13
- package/lib/languages/fil.js +207 -106
- package/lib/languages/fr-BE.d.ts +8 -8
- package/lib/languages/fr-BE.js +294 -19
- package/lib/languages/fr.d.ts +18 -12
- package/lib/languages/fr.js +352 -89
- package/lib/languages/gu.d.ts +4 -8
- package/lib/languages/gu.js +130 -125
- package/lib/languages/ha.d.ts +7 -0
- package/lib/languages/ha.js +230 -0
- package/lib/languages/hbo.d.ts +10 -110
- package/lib/languages/hbo.js +263 -214
- package/lib/languages/he.d.ts +10 -77
- package/lib/languages/he.js +242 -172
- package/lib/languages/hi.d.ts +4 -8
- package/lib/languages/hi.js +138 -124
- package/lib/languages/hr.d.ts +8 -77
- package/lib/languages/hr.js +194 -89
- package/lib/languages/hu.d.ts +4 -19
- package/lib/languages/hu.js +198 -119
- package/lib/languages/id.d.ts +4 -34
- package/lib/languages/id.js +171 -129
- package/lib/languages/it.d.ts +16 -34
- package/lib/languages/it.js +339 -94
- package/lib/languages/ja.d.ts +14 -14
- package/lib/languages/ja.js +233 -111
- package/lib/languages/kn.d.ts +4 -8
- package/lib/languages/kn.js +130 -35
- package/lib/languages/ko.d.ts +11 -11
- package/lib/languages/ko.js +257 -49
- package/lib/languages/lt.d.ts +15 -67
- package/lib/languages/lt.js +296 -122
- package/lib/languages/lv.d.ts +15 -67
- package/lib/languages/lv.js +297 -106
- package/lib/languages/mr.d.ts +4 -8
- package/lib/languages/mr.js +130 -125
- package/lib/languages/ms.d.ts +4 -28
- package/lib/languages/ms.js +171 -116
- package/lib/languages/nb.d.ts +11 -9
- package/lib/languages/nb.js +282 -87
- package/lib/languages/nl.d.ts +23 -13
- package/lib/languages/nl.js +317 -133
- package/lib/languages/pa.d.ts +4 -8
- package/lib/languages/pa.js +156 -124
- package/lib/languages/pl.d.ts +19 -77
- package/lib/languages/pl.js +307 -87
- package/lib/languages/pt.d.ts +14 -26
- package/lib/languages/pt.js +286 -92
- package/lib/languages/ro.d.ts +15 -155
- package/lib/languages/ro.js +219 -235
- package/lib/languages/ru.d.ts +8 -82
- package/lib/languages/ru.js +222 -78
- package/lib/languages/sr-Cyrl.d.ts +8 -77
- package/lib/languages/sr-Cyrl.js +191 -89
- package/lib/languages/sr-Latn.d.ts +8 -77
- package/lib/languages/sr-Latn.js +191 -89
- package/lib/languages/sv.d.ts +11 -11
- package/lib/languages/sv.js +288 -74
- package/lib/languages/sw.d.ts +4 -36
- package/lib/languages/sw.js +133 -106
- package/lib/languages/ta.d.ts +4 -17
- package/lib/languages/ta.js +129 -201
- package/lib/languages/te.d.ts +4 -19
- package/lib/languages/te.js +141 -196
- package/lib/languages/th.d.ts +4 -14
- package/lib/languages/th.js +135 -91
- package/lib/languages/tr.d.ts +15 -9
- package/lib/languages/tr.js +256 -49
- package/lib/languages/uk.d.ts +8 -82
- package/lib/languages/uk.js +200 -78
- package/lib/languages/ur.d.ts +4 -8
- package/lib/languages/ur.js +156 -124
- package/lib/languages/vi.d.ts +14 -69
- package/lib/languages/vi.js +294 -125
- package/lib/languages/zh-Hans.d.ts +8 -18
- package/lib/languages/zh-Hans.js +163 -92
- package/lib/languages/zh-Hant.d.ts +8 -18
- package/lib/languages/zh-Hant.js +181 -90
- package/lib/n2words.d.ts +53 -209
- package/lib/n2words.js +111 -530
- package/lib/utils/is-plain-object.d.ts +13 -0
- package/lib/utils/is-plain-object.js +17 -0
- package/lib/utils/parse-numeric.d.ts +17 -0
- package/lib/utils/parse-numeric.js +108 -0
- package/lib/utils/validate-options.d.ts +8 -0
- package/lib/utils/validate-options.js +16 -0
- package/package.json +26 -14
- package/dist/ArabicConverter.js +0 -3
- package/dist/ArabicConverter.js.map +0 -1
- package/dist/AzerbaijaniConverter.js +0 -3
- package/dist/AzerbaijaniConverter.js.map +0 -1
- package/dist/BanglaConverter.js +0 -3
- package/dist/BanglaConverter.js.map +0 -1
- package/dist/BiblicalHebrewConverter.js +0 -3
- package/dist/BiblicalHebrewConverter.js.map +0 -1
- package/dist/CroatianConverter.js +0 -3
- package/dist/CroatianConverter.js.map +0 -1
- package/dist/CzechConverter.js +0 -3
- package/dist/CzechConverter.js.map +0 -1
- package/dist/DanishConverter.js +0 -3
- package/dist/DanishConverter.js.map +0 -1
- package/dist/DutchConverter.js +0 -3
- package/dist/DutchConverter.js.map +0 -1
- package/dist/EnglishConverter.js +0 -3
- package/dist/EnglishConverter.js.map +0 -1
- package/dist/FilipinoConverter.js +0 -3
- package/dist/FilipinoConverter.js.map +0 -1
- package/dist/FrenchBelgiumConverter.js +0 -3
- package/dist/FrenchBelgiumConverter.js.map +0 -1
- package/dist/FrenchConverter.js +0 -3
- package/dist/FrenchConverter.js.map +0 -1
- package/dist/GermanConverter.js +0 -3
- package/dist/GermanConverter.js.map +0 -1
- package/dist/GreekConverter.js +0 -3
- package/dist/GreekConverter.js.map +0 -1
- package/dist/GujaratiConverter.js +0 -3
- package/dist/GujaratiConverter.js.map +0 -1
- package/dist/HebrewConverter.js +0 -3
- package/dist/HebrewConverter.js.map +0 -1
- package/dist/HindiConverter.js +0 -3
- package/dist/HindiConverter.js.map +0 -1
- package/dist/HungarianConverter.js +0 -3
- package/dist/HungarianConverter.js.map +0 -1
- package/dist/IndonesianConverter.js +0 -3
- package/dist/IndonesianConverter.js.map +0 -1
- package/dist/ItalianConverter.js +0 -3
- package/dist/ItalianConverter.js.map +0 -1
- package/dist/JapaneseConverter.js +0 -3
- package/dist/JapaneseConverter.js.map +0 -1
- package/dist/KannadaConverter.js +0 -3
- package/dist/KannadaConverter.js.map +0 -1
- package/dist/KoreanConverter.js +0 -3
- package/dist/KoreanConverter.js.map +0 -1
- package/dist/LatvianConverter.js +0 -3
- package/dist/LatvianConverter.js.map +0 -1
- package/dist/LithuanianConverter.js +0 -3
- package/dist/LithuanianConverter.js.map +0 -1
- package/dist/MalayConverter.js +0 -3
- package/dist/MalayConverter.js.map +0 -1
- package/dist/MarathiConverter.js +0 -3
- package/dist/MarathiConverter.js.map +0 -1
- package/dist/NorwegianBokmalConverter.js +0 -3
- package/dist/NorwegianBokmalConverter.js.map +0 -1
- package/dist/PersianConverter.js +0 -3
- package/dist/PersianConverter.js.map +0 -1
- package/dist/PolishConverter.js +0 -3
- package/dist/PolishConverter.js.map +0 -1
- package/dist/PortugueseConverter.js +0 -3
- package/dist/PortugueseConverter.js.map +0 -1
- package/dist/PunjabiConverter.js +0 -3
- package/dist/PunjabiConverter.js.map +0 -1
- package/dist/RomanianConverter.js +0 -3
- package/dist/RomanianConverter.js.map +0 -1
- package/dist/RussianConverter.js +0 -3
- package/dist/RussianConverter.js.map +0 -1
- package/dist/SerbianCyrillicConverter.js +0 -3
- package/dist/SerbianCyrillicConverter.js.map +0 -1
- package/dist/SerbianLatinConverter.js +0 -3
- package/dist/SerbianLatinConverter.js.map +0 -1
- package/dist/SimplifiedChineseConverter.js +0 -3
- package/dist/SimplifiedChineseConverter.js.map +0 -1
- package/dist/SpanishConverter.js +0 -3
- package/dist/SpanishConverter.js.map +0 -1
- package/dist/SwahiliConverter.js +0 -3
- package/dist/SwahiliConverter.js.map +0 -1
- package/dist/SwedishConverter.js +0 -3
- package/dist/SwedishConverter.js.map +0 -1
- package/dist/TamilConverter.js +0 -3
- package/dist/TamilConverter.js.map +0 -1
- package/dist/TeluguConverter.js +0 -3
- package/dist/TeluguConverter.js.map +0 -1
- package/dist/ThaiConverter.js +0 -3
- package/dist/ThaiConverter.js.map +0 -1
- package/dist/TraditionalChineseConverter.js +0 -3
- package/dist/TraditionalChineseConverter.js.map +0 -1
- package/dist/TurkishConverter.js +0 -3
- package/dist/TurkishConverter.js.map +0 -1
- package/dist/UkrainianConverter.js +0 -3
- package/dist/UkrainianConverter.js.map +0 -1
- package/dist/UrduConverter.js +0 -3
- package/dist/UrduConverter.js.map +0 -1
- package/dist/VietnameseConverter.js +0 -3
- package/dist/VietnameseConverter.js.map +0 -1
- package/lib/classes/abstract-language.d.ts +0 -178
- package/lib/classes/abstract-language.js +0 -268
- package/lib/classes/greedy-scale-language.d.ts +0 -109
- package/lib/classes/greedy-scale-language.js +0 -201
- package/lib/classes/slavic-language.d.ts +0 -148
- package/lib/classes/slavic-language.js +0 -281
- package/lib/classes/south-asian-language.d.ts +0 -70
- package/lib/classes/south-asian-language.js +0 -154
- package/lib/classes/turkic-language.d.ts +0 -26
- package/lib/classes/turkic-language.js +0 -59
package/lib/n2words.js
CHANGED
|
@@ -1,541 +1,122 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* n2words -
|
|
2
|
+
* n2words - Number to words converter
|
|
3
3
|
*
|
|
4
|
-
* This
|
|
5
|
-
*
|
|
4
|
+
* This module re-exports all language converters as named exports.
|
|
5
|
+
* Each export is a `toWords(value, options?)` function.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Export names use normalized BCP 47 codes (hyphens → camelCase):
|
|
8
|
+
* - `en`, `fr`, `de` (simple codes unchanged)
|
|
9
|
+
* - `zhHans` (zh-Hans), `frBE` (fr-BE), `srCyrl` (sr-Cyrl)
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
* 1. Language Imports - Add import statement (alphabetically sorted)
|
|
11
|
-
* 2. Language Converters - Create converter with makeConverter() (alphabetically sorted)
|
|
12
|
-
* 3. Exports - Add to export list (alphabetically sorted)
|
|
13
|
-
*
|
|
14
|
-
* Use the scaffolding tool to automate this process:
|
|
15
|
-
* npm run lang:add <language-code>
|
|
16
|
-
*
|
|
17
|
-
* ## Public API Structure
|
|
18
|
-
*
|
|
19
|
-
* Each language exports a converter function:
|
|
20
|
-
* - Name: `{LanguageName}Converter` (e.g., EnglishConverter, SpanishConverter)
|
|
21
|
-
* - Signature: `(value: NumericValue, options?: Options) => string`
|
|
22
|
-
* - Input: number, bigint, or string (numeric strings only)
|
|
23
|
-
* - Output: Words representing the number in the target language
|
|
24
|
-
*
|
|
25
|
-
* Languages without options use signature: `(value: NumericValue) => string`
|
|
26
|
-
* Languages with options define a typedef (e.g., ArabicOptions) and use: `(value: NumericValue, options?: ArabicOptions) => string`
|
|
11
|
+
* Imports and exports are alphabetically sorted by normalized name.
|
|
27
12
|
*
|
|
28
13
|
* @module n2words
|
|
29
14
|
*/
|
|
30
15
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
|
|
84
|
-
// ============================================================================
|
|
85
|
-
// Type Definitions
|
|
86
|
-
// ============================================================================
|
|
87
|
-
//
|
|
88
|
-
// This section defines TypeScript-compatible JSDoc types for:
|
|
89
|
-
// - NumericValue: The input types accepted by all converters
|
|
90
|
-
// - {Language}Options: Optional configuration for languages that support it
|
|
91
|
-
//
|
|
92
|
-
// Keep options typedefs alphabetically sorted for maintainability.
|
|
93
|
-
// ============================================================================
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Numeric value that can be converted to words.
|
|
97
|
-
* Accepts number, bigint, or numeric string representations.
|
|
98
|
-
* @typedef {number | bigint | string} NumericValue
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @typedef {Object} ArabicOptions
|
|
103
|
-
* @property {string} [negativeWord] Word for negative numbers
|
|
104
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* @typedef {Object} BiblicalHebrewOptions
|
|
109
|
-
* @property {string} [andWord='ו'] Conjunction character (typically 'ו' for and)
|
|
110
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
111
|
-
*/
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* @typedef {Object} CroatianOptions
|
|
115
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* @typedef {Object} CzechOptions
|
|
120
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* @typedef {Object} DanishOptions
|
|
125
|
-
* @property {boolean} [ordFlag=false] Enable ordinal number conversion
|
|
126
|
-
*/
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* @typedef {Object} DutchOptions
|
|
130
|
-
* @property {boolean} [includeOptionalAnd=false] Include optional "en" separator
|
|
131
|
-
* @property {boolean} [noHundredPairing=false] Disable hundred-pairing (e.g., "twelve hundred" becomes "one thousand two hundred")
|
|
132
|
-
* @property {boolean} [accentOne=true] Use accented "één" for one
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* @typedef {Object} FrenchOptions
|
|
137
|
-
* @property {boolean} [withHyphenSeparator=false] Use hyphens (true) instead of spaces (false) in compounds
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* @typedef {Object} FrenchBelgiumOptions
|
|
142
|
-
* @property {boolean} [withHyphenSeparator=false] Use hyphens (true) instead of spaces (false) in compounds
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* @typedef {Object} HebrewOptions
|
|
147
|
-
* @property {string} [andWord='ו'] Conjunction character (typically 'ו' for and)
|
|
148
|
-
*/
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* @typedef {Object} LatvianOptions
|
|
152
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
153
|
-
*/
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* @typedef {Object} LithuanianOptions
|
|
157
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
158
|
-
*/
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* @typedef {Object} PolishOptions
|
|
162
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* @typedef {Object} RomanianOptions
|
|
167
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
168
|
-
*/
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* @typedef {Object} RussianOptions
|
|
172
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
173
|
-
*/
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* @typedef {Object} SerbianCyrillicOptions
|
|
177
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
178
|
-
*/
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* @typedef {Object} SerbianLatinOptions
|
|
182
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* @typedef {Object} SimplifiedChineseOptions
|
|
187
|
-
* @property {boolean} [formal=true] Use formal/financial numerals (壹贰叁) vs. common numerals (一二三)
|
|
188
|
-
*/
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* @typedef {Object} SpanishOptions
|
|
192
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
193
|
-
*/
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* @typedef {Object} TraditionalChineseOptions
|
|
197
|
-
* @property {boolean} [formal=true] Use formal/financial numerals (壹貳參) vs. common numerals (一二三)
|
|
198
|
-
*/
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* @typedef {Object} TurkishOptions
|
|
202
|
-
* @property {boolean} [dropSpaces=false] Remove spaces between words if true
|
|
203
|
-
*/
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* @typedef {Object} UkrainianOptions
|
|
207
|
-
* @property {('masculine'|'feminine')} [gender='masculine'] Grammatical gender for number forms
|
|
208
|
-
*/
|
|
209
|
-
|
|
210
|
-
// ============================================================================
|
|
211
|
-
// Converter Factory
|
|
212
|
-
// ============================================================================
|
|
213
|
-
//
|
|
214
|
-
// makeConverter() is a factory function that creates converter functions from
|
|
215
|
-
// language classes. It provides a consistent functional API for all languages:
|
|
216
|
-
//
|
|
217
|
-
// const result = EnglishConverter(42) // "forty-two"
|
|
218
|
-
// const result = ArabicConverter(1, {gender: 'feminine'}) // "واحدة"
|
|
219
|
-
//
|
|
220
|
-
// This design:
|
|
221
|
-
// - Hides class instantiation details from public API
|
|
222
|
-
// - Ensures each conversion uses a fresh instance
|
|
223
|
-
// - Maintains immutability (no shared state between conversions)
|
|
224
|
-
// ============================================================================
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Creates a converter function for a language class.
|
|
228
|
-
*
|
|
229
|
-
* This factory handles all input validation and normalization at the public API
|
|
230
|
-
* boundary, then delegates to the language class with pre-processed data.
|
|
231
|
-
*
|
|
232
|
-
* @template {Object} [TOptions={}]
|
|
233
|
-
* @param {new (options?: TOptions) => { toWords: (isNegative: boolean, integerPart: bigint, decimalPart?: string) => string }} LanguageClass - Language class constructor
|
|
234
|
-
* @returns {(value: NumericValue, options?: TOptions) => string} Converter function
|
|
235
|
-
*/
|
|
236
|
-
function makeConverter (LanguageClass) {
|
|
237
|
-
/**
|
|
238
|
-
* @param {NumericValue} value
|
|
239
|
-
* @param {TOptions} [options]
|
|
240
|
-
* @returns {string}
|
|
241
|
-
*/
|
|
242
|
-
return function convertToWords (value, options) {
|
|
243
|
-
if (options !== undefined && !isPlainObject(options)) {
|
|
244
|
-
throw new TypeError('options must be a plain object if provided')
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
const { isNegative, integerPart, decimalPart } = parseNumericValue(value)
|
|
248
|
-
return new LanguageClass(options).toWords(isNegative, integerPart, decimalPart)
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// ============================================================================
|
|
253
|
-
// Input Parsing Utilities
|
|
254
|
-
// ============================================================================
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* @typedef {Object} ParsedNumericValue
|
|
258
|
-
* @property {boolean} isNegative - Whether the value is negative
|
|
259
|
-
* @property {bigint} integerPart - The absolute integer part
|
|
260
|
-
* @property {string} [decimalPart] - The decimal digits (without the point)
|
|
261
|
-
*/
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Parses and validates a numeric value into its components.
|
|
265
|
-
* Handles number, string, and bigint inputs uniformly.
|
|
266
|
-
*
|
|
267
|
-
* @param {NumericValue} value The value to parse
|
|
268
|
-
* @returns {ParsedNumericValue} The parsed components
|
|
269
|
-
* @throws {TypeError} If value is not a valid numeric type
|
|
270
|
-
* @throws {Error} If value is not a valid number format
|
|
271
|
-
*/
|
|
272
|
-
function parseNumericValue (value) {
|
|
273
|
-
const type = typeof value
|
|
274
|
-
|
|
275
|
-
// BigInt: simplest case - no decimals, no scientific notation
|
|
276
|
-
if (type === 'bigint') {
|
|
277
|
-
return value < 0n
|
|
278
|
-
? { isNegative: true, integerPart: -value }
|
|
279
|
-
: { isNegative: false, integerPart: value }
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// Reject invalid types early
|
|
283
|
-
if (type !== 'number' && type !== 'string') {
|
|
284
|
-
throw new TypeError(
|
|
285
|
-
`Invalid value type: expected number, string, or bigint, received ${type}`
|
|
286
|
-
)
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// Convert to normalized string
|
|
290
|
-
const str = type === 'number'
|
|
291
|
-
? numberToString(value)
|
|
292
|
-
: stringToNormalizedForm(value)
|
|
293
|
-
|
|
294
|
-
return parseNumericString(str)
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Converts a JavaScript number to a decimal string.
|
|
299
|
-
* Handles special cases: Infinity, NaN, and scientific notation.
|
|
300
|
-
*
|
|
301
|
-
* @param {number} value The number to convert
|
|
302
|
-
* @returns {string} Decimal string representation
|
|
303
|
-
* @throws {Error} If value is not finite
|
|
304
|
-
*/
|
|
305
|
-
function numberToString (value) {
|
|
306
|
-
if (!Number.isFinite(value)) {
|
|
307
|
-
throw new Error('Number must be finite (NaN and Infinity are not supported)')
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
const str = value.toString()
|
|
311
|
-
|
|
312
|
-
// Expand scientific notation (used for values >= 1e21 or < 1e-6)
|
|
313
|
-
if (str.includes('e') || str.includes('E')) {
|
|
314
|
-
return expandScientificNotation(str)
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
return str
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Validates and normalizes a string numeric input.
|
|
322
|
-
*
|
|
323
|
-
* @param {string} value The string to validate
|
|
324
|
-
* @returns {string} Trimmed and validated string
|
|
325
|
-
* @throws {Error} If string is empty or not a valid number format
|
|
326
|
-
*/
|
|
327
|
-
function stringToNormalizedForm (value) {
|
|
328
|
-
const trimmed = value.trim()
|
|
329
|
-
|
|
330
|
-
if (trimmed.length === 0) {
|
|
331
|
-
throw new Error(`Invalid number format: "${value}"`)
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
// Validate by attempting conversion (handles edge cases like "1e21", "-.5", etc.)
|
|
335
|
-
if (Number.isNaN(Number(trimmed))) {
|
|
336
|
-
throw new Error(`Invalid number format: "${value}"`)
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Expand scientific notation if present
|
|
340
|
-
if (trimmed.includes('e') || trimmed.includes('E')) {
|
|
341
|
-
return expandScientificNotation(trimmed)
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
return trimmed
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Parses a normalized numeric string into its components.
|
|
349
|
-
*
|
|
350
|
-
* @param {string} str A normalized decimal string (no scientific notation)
|
|
351
|
-
* @returns {ParsedNumericValue} The parsed components
|
|
352
|
-
*/
|
|
353
|
-
function parseNumericString (str) {
|
|
354
|
-
// Extract sign
|
|
355
|
-
const isNegative = str[0] === '-'
|
|
356
|
-
if (isNegative) {
|
|
357
|
-
str = str.slice(1)
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
// Split into integer and decimal parts
|
|
361
|
-
const dotIndex = str.indexOf('.')
|
|
362
|
-
if (dotIndex === -1) {
|
|
363
|
-
return { isNegative, integerPart: BigInt(str) }
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
const integerStr = str.slice(0, dotIndex) || '0'
|
|
367
|
-
const decimalPart = str.slice(dotIndex + 1)
|
|
368
|
-
|
|
369
|
-
return { isNegative, integerPart: BigInt(integerStr), decimalPart }
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Expands scientific notation to decimal form.
|
|
374
|
-
* JavaScript uses scientific notation for values >= 1e21 or < 1e-6.
|
|
375
|
-
*
|
|
376
|
-
* @param {string} str String possibly in scientific notation (e.g., "1e+21")
|
|
377
|
-
* @returns {string} Decimal form (e.g., "1000000000000000000000")
|
|
378
|
-
*/
|
|
379
|
-
function expandScientificNotation (str) {
|
|
380
|
-
const [mantissa, expStr] = str.toLowerCase().split('e')
|
|
381
|
-
const exp = parseInt(expStr, 10)
|
|
382
|
-
|
|
383
|
-
// Extract digits and determine original decimal position
|
|
384
|
-
const dotIndex = mantissa.indexOf('.')
|
|
385
|
-
const digits = dotIndex === -1
|
|
386
|
-
? mantissa
|
|
387
|
-
: mantissa.slice(0, dotIndex) + mantissa.slice(dotIndex + 1)
|
|
388
|
-
const integerLength = dotIndex === -1 ? mantissa.length : dotIndex
|
|
389
|
-
|
|
390
|
-
// Calculate new decimal position after applying exponent
|
|
391
|
-
const newDotPosition = integerLength + exp
|
|
392
|
-
|
|
393
|
-
if (newDotPosition >= digits.length) {
|
|
394
|
-
// Pure integer: pad with trailing zeros
|
|
395
|
-
return digits + '0'.repeat(newDotPosition - digits.length)
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
if (newDotPosition <= 0) {
|
|
399
|
-
// Pure decimal: pad with leading zeros after decimal point
|
|
400
|
-
return '0.' + '0'.repeat(-newDotPosition) + digits
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
// Mixed: insert decimal point at new position
|
|
404
|
-
return digits.slice(0, newDotPosition) + '.' + digits.slice(newDotPosition)
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Checks if a value is a plain object (not null, array, or other object types).
|
|
409
|
-
*
|
|
410
|
-
* @param {*} value Value to check
|
|
411
|
-
* @returns {boolean} True if value is a plain object
|
|
412
|
-
*/
|
|
413
|
-
function isPlainObject (value) {
|
|
414
|
-
if (value === null || typeof value !== 'object') return false
|
|
415
|
-
const proto = Object.getPrototypeOf(value)
|
|
416
|
-
return proto === Object.prototype || proto === null
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
// ============================================================================
|
|
420
|
-
// Language Converters
|
|
421
|
-
// ============================================================================
|
|
422
|
-
//
|
|
423
|
-
// Each converter is created using makeConverter() with explicit type annotations.
|
|
424
|
-
//
|
|
425
|
-
// Pattern for languages WITHOUT options:
|
|
426
|
-
// const LanguageConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Language))
|
|
427
|
-
//
|
|
428
|
-
// Pattern for languages WITH options:
|
|
429
|
-
// const LanguageConverter = /** @type {(value: NumericValue, options?: LanguageOptions) => string} */ (makeConverter(Language))
|
|
430
|
-
//
|
|
431
|
-
// IMPORTANT: Keep converters alphabetically sorted by converter name.
|
|
432
|
-
// ============================================================================
|
|
433
|
-
|
|
434
|
-
const ArabicConverter = /** @type {(value: NumericValue, options?: ArabicOptions) => string} */ (makeConverter(Arabic))
|
|
435
|
-
const AzerbaijaniConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Azerbaijani))
|
|
436
|
-
const BanglaConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Bangla))
|
|
437
|
-
const BiblicalHebrewConverter = /** @type {(value: NumericValue, options?: BiblicalHebrewOptions) => string} */ (makeConverter(BiblicalHebrew))
|
|
438
|
-
const CroatianConverter = /** @type {(value: NumericValue, options?: CroatianOptions) => string} */ (makeConverter(Croatian))
|
|
439
|
-
const CzechConverter = /** @type {(value: NumericValue, options?: CzechOptions) => string} */ (makeConverter(Czech))
|
|
440
|
-
const DanishConverter = /** @type {(value: NumericValue, options?: DanishOptions) => string} */ (makeConverter(Danish))
|
|
441
|
-
const DutchConverter = /** @type {(value: NumericValue, options?: DutchOptions) => string} */ (makeConverter(Dutch))
|
|
442
|
-
const EnglishConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(English))
|
|
443
|
-
const FilipinoConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Filipino))
|
|
444
|
-
const FrenchConverter = /** @type {(value: NumericValue, options?: FrenchOptions) => string} */ (makeConverter(French))
|
|
445
|
-
const FrenchBelgiumConverter = /** @type {(value: NumericValue, options?: FrenchBelgiumOptions) => string} */ (makeConverter(FrenchBelgium))
|
|
446
|
-
const GermanConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(German))
|
|
447
|
-
const GreekConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Greek))
|
|
448
|
-
const GujaratiConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Gujarati))
|
|
449
|
-
const HebrewConverter = /** @type {(value: NumericValue, options?: HebrewOptions) => string} */ (makeConverter(Hebrew))
|
|
450
|
-
const HindiConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Hindi))
|
|
451
|
-
const HungarianConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Hungarian))
|
|
452
|
-
const IndonesianConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Indonesian))
|
|
453
|
-
const ItalianConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Italian))
|
|
454
|
-
const JapaneseConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Japanese))
|
|
455
|
-
const KannadaConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Kannada))
|
|
456
|
-
const KoreanConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Korean))
|
|
457
|
-
const LatvianConverter = /** @type {(value: NumericValue, options?: LatvianOptions) => string} */ (makeConverter(Latvian))
|
|
458
|
-
const LithuanianConverter = /** @type {(value: NumericValue, options?: LithuanianOptions) => string} */ (makeConverter(Lithuanian))
|
|
459
|
-
const MalayConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Malay))
|
|
460
|
-
const MarathiConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Marathi))
|
|
461
|
-
const NorwegianBokmalConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(NorwegianBokmal))
|
|
462
|
-
const PersianConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Persian))
|
|
463
|
-
const PolishConverter = /** @type {(value: NumericValue, options?: PolishOptions) => string} */ (makeConverter(Polish))
|
|
464
|
-
const PortugueseConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Portuguese))
|
|
465
|
-
const PunjabiConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Punjabi))
|
|
466
|
-
const RomanianConverter = /** @type {(value: NumericValue, options?: RomanianOptions) => string} */ (makeConverter(Romanian))
|
|
467
|
-
const RussianConverter = /** @type {(value: NumericValue, options?: RussianOptions) => string} */ (makeConverter(Russian))
|
|
468
|
-
const SerbianCyrillicConverter = /** @type {(value: NumericValue, options?: SerbianCyrillicOptions) => string} */ (makeConverter(SerbianCyrillic))
|
|
469
|
-
const SerbianLatinConverter = /** @type {(value: NumericValue, options?: SerbianLatinOptions) => string} */ (makeConverter(SerbianLatin))
|
|
470
|
-
const SimplifiedChineseConverter = /** @type {(value: NumericValue, options?: SimplifiedChineseOptions) => string} */ (makeConverter(SimplifiedChinese))
|
|
471
|
-
const SpanishConverter = /** @type {(value: NumericValue, options?: SpanishOptions) => string} */ (makeConverter(Spanish))
|
|
472
|
-
const SwahiliConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Swahili))
|
|
473
|
-
const SwedishConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Swedish))
|
|
474
|
-
const TamilConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Tamil))
|
|
475
|
-
const TeluguConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Telugu))
|
|
476
|
-
const ThaiConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Thai))
|
|
477
|
-
const TraditionalChineseConverter = /** @type {(value: NumericValue, options?: TraditionalChineseOptions) => string} */ (makeConverter(TraditionalChinese))
|
|
478
|
-
const TurkishConverter = /** @type {(value: NumericValue, options?: TurkishOptions) => string} */ (makeConverter(Turkish))
|
|
479
|
-
const UkrainianConverter = /** @type {(value: NumericValue, options?: UkrainianOptions) => string} */ (makeConverter(Ukrainian))
|
|
480
|
-
const UrduConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Urdu))
|
|
481
|
-
const VietnameseConverter = /** @type {(value: NumericValue) => string} */ (makeConverter(Vietnamese))
|
|
482
|
-
|
|
483
|
-
// ============================================================================
|
|
484
|
-
// Exports
|
|
485
|
-
// ============================================================================
|
|
486
|
-
//
|
|
487
|
-
// All converter functions are exported for public use.
|
|
488
|
-
//
|
|
489
|
-
// IMPORTANT: Keep exports alphabetically sorted for maintainability.
|
|
490
|
-
// ============================================================================
|
|
16
|
+
import { toWords as am } from './languages/am.js'
|
|
17
|
+
import { toWords as amLatn } from './languages/am-Latn.js'
|
|
18
|
+
import { toWords as ar } from './languages/ar.js'
|
|
19
|
+
import { toWords as az } from './languages/az.js'
|
|
20
|
+
import { toWords as bn } from './languages/bn.js'
|
|
21
|
+
import { toWords as cs } from './languages/cs.js'
|
|
22
|
+
import { toWords as da } from './languages/da.js'
|
|
23
|
+
import { toWords as de } from './languages/de.js'
|
|
24
|
+
import { toWords as el } from './languages/el.js'
|
|
25
|
+
import { toWords as en } from './languages/en.js'
|
|
26
|
+
import { toWords as es } from './languages/es.js'
|
|
27
|
+
import { toWords as fa } from './languages/fa.js'
|
|
28
|
+
import { toWords as fi } from './languages/fi.js'
|
|
29
|
+
import { toWords as fil } from './languages/fil.js'
|
|
30
|
+
import { toWords as fr } from './languages/fr.js'
|
|
31
|
+
import { toWords as frBE } from './languages/fr-BE.js'
|
|
32
|
+
import { toWords as gu } from './languages/gu.js'
|
|
33
|
+
import { toWords as ha } from './languages/ha.js'
|
|
34
|
+
import { toWords as hbo } from './languages/hbo.js'
|
|
35
|
+
import { toWords as he } from './languages/he.js'
|
|
36
|
+
import { toWords as hi } from './languages/hi.js'
|
|
37
|
+
import { toWords as hr } from './languages/hr.js'
|
|
38
|
+
import { toWords as hu } from './languages/hu.js'
|
|
39
|
+
import { toWords as id } from './languages/id.js'
|
|
40
|
+
import { toWords as it } from './languages/it.js'
|
|
41
|
+
import { toWords as ja } from './languages/ja.js'
|
|
42
|
+
import { toWords as kn } from './languages/kn.js'
|
|
43
|
+
import { toWords as ko } from './languages/ko.js'
|
|
44
|
+
import { toWords as lt } from './languages/lt.js'
|
|
45
|
+
import { toWords as lv } from './languages/lv.js'
|
|
46
|
+
import { toWords as mr } from './languages/mr.js'
|
|
47
|
+
import { toWords as ms } from './languages/ms.js'
|
|
48
|
+
import { toWords as nb } from './languages/nb.js'
|
|
49
|
+
import { toWords as nl } from './languages/nl.js'
|
|
50
|
+
import { toWords as pa } from './languages/pa.js'
|
|
51
|
+
import { toWords as pl } from './languages/pl.js'
|
|
52
|
+
import { toWords as pt } from './languages/pt.js'
|
|
53
|
+
import { toWords as ro } from './languages/ro.js'
|
|
54
|
+
import { toWords as ru } from './languages/ru.js'
|
|
55
|
+
import { toWords as srCyrl } from './languages/sr-Cyrl.js'
|
|
56
|
+
import { toWords as srLatn } from './languages/sr-Latn.js'
|
|
57
|
+
import { toWords as sv } from './languages/sv.js'
|
|
58
|
+
import { toWords as sw } from './languages/sw.js'
|
|
59
|
+
import { toWords as ta } from './languages/ta.js'
|
|
60
|
+
import { toWords as te } from './languages/te.js'
|
|
61
|
+
import { toWords as th } from './languages/th.js'
|
|
62
|
+
import { toWords as tr } from './languages/tr.js'
|
|
63
|
+
import { toWords as uk } from './languages/uk.js'
|
|
64
|
+
import { toWords as ur } from './languages/ur.js'
|
|
65
|
+
import { toWords as vi } from './languages/vi.js'
|
|
66
|
+
import { toWords as zhHans } from './languages/zh-Hans.js'
|
|
67
|
+
import { toWords as zhHant } from './languages/zh-Hant.js'
|
|
491
68
|
|
|
492
69
|
export {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
70
|
+
am,
|
|
71
|
+
amLatn,
|
|
72
|
+
ar,
|
|
73
|
+
az,
|
|
74
|
+
bn,
|
|
75
|
+
cs,
|
|
76
|
+
da,
|
|
77
|
+
de,
|
|
78
|
+
el,
|
|
79
|
+
en,
|
|
80
|
+
es,
|
|
81
|
+
fa,
|
|
82
|
+
fi,
|
|
83
|
+
fil,
|
|
84
|
+
fr,
|
|
85
|
+
frBE,
|
|
86
|
+
gu,
|
|
87
|
+
ha,
|
|
88
|
+
hbo,
|
|
89
|
+
he,
|
|
90
|
+
hi,
|
|
91
|
+
hr,
|
|
92
|
+
hu,
|
|
93
|
+
id,
|
|
94
|
+
it,
|
|
95
|
+
ja,
|
|
96
|
+
kn,
|
|
97
|
+
ko,
|
|
98
|
+
lt,
|
|
99
|
+
lv,
|
|
100
|
+
mr,
|
|
101
|
+
ms,
|
|
102
|
+
nb,
|
|
103
|
+
nl,
|
|
104
|
+
pa,
|
|
105
|
+
pl,
|
|
106
|
+
pt,
|
|
107
|
+
ro,
|
|
108
|
+
ru,
|
|
109
|
+
srCyrl,
|
|
110
|
+
srLatn,
|
|
111
|
+
sv,
|
|
112
|
+
sw,
|
|
113
|
+
ta,
|
|
114
|
+
te,
|
|
115
|
+
th,
|
|
116
|
+
tr,
|
|
117
|
+
uk,
|
|
118
|
+
ur,
|
|
119
|
+
vi,
|
|
120
|
+
zhHans,
|
|
121
|
+
zhHant
|
|
541
122
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a value is a plain object (not null, array, or other object types).
|
|
3
|
+
*
|
|
4
|
+
* A plain object is one created by:
|
|
5
|
+
* - Object literal: `{}`
|
|
6
|
+
* - Object.create(null): null-prototype object
|
|
7
|
+
*
|
|
8
|
+
* This excludes arrays, class instances, Map, Set, and other object types.
|
|
9
|
+
*
|
|
10
|
+
* @param {*} value Value to check
|
|
11
|
+
* @returns {boolean} True if value is a plain object
|
|
12
|
+
*/
|
|
13
|
+
export function isPlainObject(value: any): boolean;
|