n2words 1.19.0 → 1.20.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.
Files changed (66) hide show
  1. package/dist/n2words.d.ts +0 -1
  2. package/dist/n2words.js +1 -1
  3. package/dist/n2words.js.map +1 -1
  4. package/lib/classes/AbstractLanguage.d.ts +4 -4
  5. package/lib/classes/AbstractLanguage.js +18 -19
  6. package/lib/classes/BaseLanguage.d.ts +11 -7
  7. package/lib/classes/BaseLanguage.js +13 -6
  8. package/lib/i18n/ar.d.ts +17 -4
  9. package/lib/i18n/ar.js +60 -58
  10. package/lib/i18n/az.d.ts +2 -2
  11. package/lib/i18n/az.js +1 -1
  12. package/lib/i18n/cz.d.ts +2 -2
  13. package/lib/i18n/cz.js +1 -1
  14. package/lib/i18n/de.d.ts +2 -2
  15. package/lib/i18n/de.js +1 -1
  16. package/lib/i18n/dk.d.ts +2 -2
  17. package/lib/i18n/dk.js +1 -1
  18. package/lib/i18n/en.d.ts +2 -2
  19. package/lib/i18n/en.js +1 -1
  20. package/lib/i18n/es.d.ts +2 -2
  21. package/lib/i18n/es.js +1 -1
  22. package/lib/i18n/fa.d.ts +2 -2
  23. package/lib/i18n/fa.js +1 -1
  24. package/lib/i18n/fr-BE.d.ts +2 -2
  25. package/lib/i18n/fr-BE.js +1 -1
  26. package/lib/i18n/fr.d.ts +2 -2
  27. package/lib/i18n/fr.js +1 -1
  28. package/lib/i18n/he.d.ts +2 -2
  29. package/lib/i18n/he.js +1 -1
  30. package/lib/i18n/hr.d.ts +2 -2
  31. package/lib/i18n/hr.js +1 -1
  32. package/lib/i18n/hu.d.ts +2 -2
  33. package/lib/i18n/hu.js +1 -1
  34. package/lib/i18n/id.d.ts +2 -2
  35. package/lib/i18n/id.js +1 -1
  36. package/lib/i18n/it.d.ts +2 -2
  37. package/lib/i18n/it.js +1 -1
  38. package/lib/i18n/ko.d.ts +2 -2
  39. package/lib/i18n/ko.js +1 -1
  40. package/lib/i18n/lt.d.ts +2 -2
  41. package/lib/i18n/lt.js +1 -1
  42. package/lib/i18n/lv.d.ts +2 -2
  43. package/lib/i18n/lv.js +1 -1
  44. package/lib/i18n/nl.d.ts +2 -2
  45. package/lib/i18n/nl.js +1 -1
  46. package/lib/i18n/no.d.ts +2 -2
  47. package/lib/i18n/no.js +1 -1
  48. package/lib/i18n/pl.d.ts +2 -2
  49. package/lib/i18n/pl.js +1 -1
  50. package/lib/i18n/pt.d.ts +2 -2
  51. package/lib/i18n/pt.js +1 -1
  52. package/lib/i18n/ru.d.ts +2 -2
  53. package/lib/i18n/ru.js +1 -1
  54. package/lib/i18n/sr.d.ts +2 -2
  55. package/lib/i18n/sr.js +1 -1
  56. package/lib/i18n/tr.d.ts +2 -2
  57. package/lib/i18n/tr.js +1 -1
  58. package/lib/i18n/uk.d.ts +2 -2
  59. package/lib/i18n/uk.js +1 -1
  60. package/lib/i18n/vi.d.ts +2 -2
  61. package/lib/i18n/vi.js +1 -1
  62. package/lib/i18n/zh.d.ts +2 -2
  63. package/lib/i18n/zh.js +1 -1
  64. package/lib/n2words.d.ts +2 -2
  65. package/lib/n2words.js +3 -3
  66. package/package.json +5 -5
@@ -37,17 +37,17 @@ export default class _default {
37
37
  */
38
38
  get wholeNumber(): number;
39
39
  /**
40
- * Convert decimal number to a string array of cardinal numbers.
40
+ * Convert ONLY decimal portion of number (processing leading zeros) to a string array of cardinal numbers.
41
41
  * @param {string} decimal Decimal string to convert.
42
42
  * @returns {string} Value in written format.
43
43
  */
44
44
  decimalToCardinal(decimal: string): string;
45
45
  /**
46
- * Converts a number to written form.
47
- * @param {number|string} value Number to be convert.
46
+ * Convert a number to cardinal form.
47
+ * @param {number|string|bigint} value Number to be convert.
48
48
  * @throws {Error} Value must be a valid number.
49
49
  * @returns {string} Value in written format.
50
50
  */
51
- floatToCardinal(value: number | string): string;
51
+ floatToCardinal(value: number | string | bigint): string;
52
52
  #private;
53
53
  }
@@ -20,8 +20,8 @@ export default class {
20
20
  // Merge supplied options with defaults
21
21
  options = Object.assign({
22
22
  negativeWord: '',
23
- separatorWord: undefined,
24
- zero: undefined,
23
+ separatorWord: '',
24
+ zero: '',
25
25
  spaceSeparator: ' '
26
26
  }, options);
27
27
 
@@ -68,41 +68,40 @@ export default class {
68
68
  }
69
69
 
70
70
  /**
71
- * Convert decimal number to a string array of cardinal numbers.
71
+ * Convert ONLY decimal portion of number (processing leading zeros) to a string array of cardinal numbers.
72
72
  * @param {string} decimal Decimal string to convert.
73
73
  * @returns {string} Value in written format.
74
74
  */
75
75
  decimalToCardinal(decimal) {
76
76
  const words = [];
77
- let allZero = true;
78
77
 
79
- // Split decimal portion into an array of characters
78
+ // Split decimal string into an array of characters
80
79
  const chars = decimal.split('');
81
80
 
82
- // Loop through characters adding zeros to output array
83
- chars.forEach(char => {
84
- if (char === '0') {
85
- words.push(this.zero);
86
- } else {
87
- allZero = false;
88
- }
89
- });
81
+ // Loop through characters adding leading zeros to words array
82
+ let i = 0;
83
+ while (i < chars.length && chars[i] === '0') {
84
+ words.push(this.zero);
85
+ i++;
86
+ }
90
87
 
91
- if (allZero) {
88
+ // Prevent further processing if entire string was zeros
89
+ if (i === chars.length) {
92
90
  return words;
93
91
  }
94
92
 
93
+ // Convert and add remaining then return words array
95
94
  return words.concat(this.toCardinal(BigInt(decimal)));
96
95
  }
97
96
 
98
97
  /**
99
- * Converts a number to written form.
100
- * @param {number|string} value Number to be convert.
98
+ * Convert a number to cardinal form.
99
+ * @param {number|string|bigint} value Number to be convert.
101
100
  * @throws {Error} Value must be a valid number.
102
101
  * @returns {string} Value in written format.
103
102
  */
104
103
  floatToCardinal(value) {
105
- // Validate user input value
104
+ // Validate user input value and convert to string (excluding BigInt)
106
105
  if (typeof value == 'number') {
107
106
  if (Number.isNaN(value)) {
108
107
  throw new Error('NaN is not an accepted number.');
@@ -110,7 +109,7 @@ export default class {
110
109
  value = value.toString();
111
110
  } else if (typeof value == 'string') {
112
111
  value = value.trim();
113
- if (value.length == 0 || Number.isNaN(Number(value))) {
112
+ if (value.length === 0 || Number.isNaN(Number(value))) {
114
113
  throw new Error('"' + value + '" is not a valid number.');
115
114
  }
116
115
  } else if (typeof value != 'bigint') {
@@ -126,7 +125,7 @@ export default class {
126
125
  words.push(this.negativeWord);
127
126
  }
128
127
 
129
- // Split value decimal (if any) (excluding BigInt)
128
+ // Split value decimal (if any) then convert to BigInt
130
129
  if (typeof value == 'bigint') {
131
130
  wholeNumber = value;
132
131
  } else {
@@ -20,7 +20,7 @@ export default class _default extends AbstractLanguage {
20
20
  spaceSeparator?: string;
21
21
  }, cards: any[]);
22
22
  /**
23
- * Get array of number matching "cards" from highest-to-lowest.
23
+ * Set array of number matching "cards" from highest-to-lowest.
24
24
  * First element in card array is the number to match while the second is the word to use.
25
25
  * @example
26
26
  * [
@@ -29,30 +29,34 @@ export default class _default extends AbstractLanguage {
29
29
  * ...
30
30
  * [1, 'one'],
31
31
  * ]
32
+ */
33
+ set cards(value: any[]);
34
+ /**
35
+ * Get array of number matching "cards" from highest-to-lowest.
32
36
  * @returns {Array} Array of number matching "cards" from highest-to-lowest.
33
37
  */
34
38
  get cards(): any[];
35
39
  /**
36
40
  * Get word for number if it matches a language card.
37
- * @param {number} number Card number value.
41
+ * @param {number|bigint} number Card number value.
38
42
  * @returns {string|undefined} Return card word or undefined if no card.
39
43
  */
40
- getCardWord(number: number): string | undefined;
44
+ getCardWord(number: number | bigint): string | undefined;
41
45
  /**
42
46
  * Get array of card matches.
43
- * @param {number} value The number value to convert to cardinal form.
47
+ * @param {number|bigint} value The number value to convert to cardinal form.
44
48
  * @returns {object} Word sets (and pairs) from value.
45
49
  * @todo Simplify return object.
46
50
  */
47
- toCardMatches(value: number): object;
51
+ toCardMatches(value: number | bigint): object;
48
52
  clean(words: any): any;
49
53
  postClean(out0: any): any;
50
54
  /**
51
55
  * Convert a whole number to written format.
52
- * @param {number} value The number value to convert to cardinal form.
56
+ * @param {number|bigint} value The number value to convert to cardinal form.
53
57
  * @returns {string} Value in written format.
54
58
  */
55
- toCardinal(value: number): string;
59
+ toCardinal(value: number | bigint): string;
56
60
  #private;
57
61
  }
58
62
  import AbstractLanguage from './AbstractLanguage.js';
@@ -25,6 +25,14 @@ export default class extends AbstractLanguage {
25
25
 
26
26
  /**
27
27
  * Get array of number matching "cards" from highest-to-lowest.
28
+ * @returns {Array} Array of number matching "cards" from highest-to-lowest.
29
+ */
30
+ get cards() {
31
+ return this.#cards;
32
+ }
33
+
34
+ /**
35
+ * Set array of number matching "cards" from highest-to-lowest.
28
36
  * First element in card array is the number to match while the second is the word to use.
29
37
  * @example
30
38
  * [
@@ -33,15 +41,14 @@ export default class extends AbstractLanguage {
33
41
  * ...
34
42
  * [1, 'one'],
35
43
  * ]
36
- * @returns {Array} Array of number matching "cards" from highest-to-lowest.
37
44
  */
38
- get cards() {
39
- return this.#cards;
45
+ set cards(value) {
46
+ this.#cards = value;
40
47
  }
41
48
 
42
49
  /**
43
50
  * Get word for number if it matches a language card.
44
- * @param {number} number Card number value.
51
+ * @param {number|bigint} number Card number value.
45
52
  * @returns {string|undefined} Return card word or undefined if no card.
46
53
  */
47
54
  getCardWord(number) {
@@ -54,7 +61,7 @@ export default class extends AbstractLanguage {
54
61
 
55
62
  /**
56
63
  * Get array of card matches.
57
- * @param {number} value The number value to convert to cardinal form.
64
+ * @param {number|bigint} value The number value to convert to cardinal form.
58
65
  * @returns {object} Word sets (and pairs) from value.
59
66
  * @todo Simplify return object.
60
67
  */
@@ -153,7 +160,7 @@ export default class extends AbstractLanguage {
153
160
 
154
161
  /**
155
162
  * Convert a whole number to written format.
156
- * @param {number} value The number value to convert to cardinal form.
163
+ * @param {number|bigint} value The number value to convert to cardinal form.
157
164
  * @returns {string} Value in written format.
158
165
  */
159
166
  toCardinal(value) {
package/lib/i18n/ar.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Converts a value to cardinal (written) form.
3
- * @param {number|string} value Number to be convert.
3
+ * @param {number|string|bigint} value Number to be convert.
4
4
  * @param {object} [options] Options for class.
5
5
  * @throws {Error} Value cannot be invalid.
6
6
  * @returns {string} Value in cardinal (written) format.
7
7
  */
8
- export default function _default(value: number | string, options?: object): string;
8
+ export default function _default(value: number | string | bigint, options?: object): string;
9
9
  export class Arabic extends AbstractLanguage {
10
10
  constructor(options: any);
11
11
  number: any;
@@ -22,7 +22,20 @@ export class Arabic extends AbstractLanguage {
22
22
  arabicAppendedGroup: string[];
23
23
  arabicPluralGroups: string[];
24
24
  digitFeminineStatus(digit: any): string;
25
- processArabicGroup(groupNumber: any, groupLevel: any, remainingNumber: any): string;
26
- toCardinal(number: any): string;
25
+ /**
26
+ * Processes the Arabic group number and returns the corresponding Arabic representation.
27
+ * @param {number} groupNumber - The number to process. From 1 to 999.
28
+ * @param {number} groupLevel - The level of the group.
29
+ * Example: 12345678 is processed in blocks: '678' (group 0), '345' (group 1), '12' (group 2)
30
+ * @returns {string} The Arabic representation of the group number.
31
+ */
32
+ processArabicGroup(groupNumber: number, groupLevel: number): string;
33
+ /**
34
+ * Converts a number to its cardinal representation in Arabic.
35
+ * It process by blocks of 3 digits.
36
+ * @param {number} number - The number to convert.
37
+ * @returns {string} The cardinal representation of the number in Arabic.
38
+ */
39
+ toCardinal(number: number): string;
27
40
  }
28
41
  import AbstractLanguage from '../classes/AbstractLanguage.js';
package/lib/i18n/ar.js CHANGED
@@ -28,7 +28,7 @@ export class Arabic extends AbstractLanguage {
28
28
  'تسعة عشر',
29
29
  ],
30
30
  feminine: [
31
- 'إحدى',
31
+ 'واحدة',
32
32
  'اثنتان',
33
33
  'ثلاث',
34
34
  'أربع',
@@ -64,10 +64,6 @@ export class Arabic extends AbstractLanguage {
64
64
 
65
65
  arabicPluralGroups = ['', 'آلاف', 'ملايين', 'مليارات', 'تريليونات', 'كوادريليونات', 'كوينتليونات', 'سكستيليونات'];
66
66
 
67
- // isCurrencyPartNameFeminine = true
68
-
69
- // isCurrencyNameFeminine = false
70
-
71
67
  constructor(options) {
72
68
  options = Object.assign({
73
69
  negativeWord: 'ناقص',
@@ -82,67 +78,70 @@ export class Arabic extends AbstractLanguage {
82
78
  }
83
79
 
84
80
  digitFeminineStatus(digit) {
85
- // if ((groupLevel == -1 && this.isCurrencyPartNameFeminine) || (groupLevel == 0 && this.isCurrencyNameFeminine)) {
86
- // return this.arabicFeminineOnes[digit]
87
- // }
88
81
  return this.ones[this.feminine ? 'feminine' : 'masculine'][digit - 1];
89
82
  }
90
83
 
91
- processArabicGroup(groupNumber, groupLevel, remainingNumber) {
84
+ /**
85
+ * Processes the Arabic group number and returns the corresponding Arabic representation.
86
+ * @param {number} groupNumber - The number to process. From 1 to 999.
87
+ * @param {number} groupLevel - The level of the group.
88
+ * Example: 12345678 is processed in blocks: '678' (group 0), '345' (group 1), '12' (group 2)
89
+ * @returns {string} The Arabic representation of the group number.
90
+ */
91
+ processArabicGroup(groupNumber, groupLevel) {
92
92
  let tens = groupNumber % 100;
93
93
  const hundreds = groupNumber / 100;
94
94
  let retVal = '';
95
95
 
96
- if (hundreds > 0) {
97
- retVal = (tens == 0 && Math.trunc(hundreds) == 2 ? this.arabicAppendedTwos[0] : this.arabicHundreds[Math.trunc(hundreds)]);
96
+ if (Math.trunc(hundreds) > 0) {
97
+ if (tens == 0 && Math.trunc(hundreds) == 2) {
98
+ retVal = this.arabicTwos[0];
99
+ } else {
100
+ retVal = this.arabicHundreds[Math.trunc(hundreds)];
101
+ if (retVal != '' && tens != 0) {
102
+ retVal += ' و';
103
+ }
104
+ }
98
105
  }
99
106
 
100
- if (tens > 0) {
101
- if (tens < 20) {
102
- if (tens == 2 && Math.trunc(hundreds) == 0 && groupLevel > 0) {
103
- retVal = ([
104
- 2000, 2000000, 2000000000, 2000000000000, 2000000000000000, 2000000000000000000
105
- ].indexOf(this.number) != -1) ? this.arabicAppendedTwos[groupLevel] : this.arabicTwos[groupLevel];
106
- } else {
107
- // Add divider
108
- if (retVal != '') {
109
- retVal += ' و ';
110
- }
111
-
112
- if (tens == 1 && groupLevel > 0 && hundreds == 0) {
113
- retVal += '';
114
- } else if (
115
- (tens == 1 || tens == 2) &&
116
- (groupLevel == 0 || groupLevel == -1) &&
117
- (hundreds == 0 && remainingNumber == 0)
118
- ) {
119
- retVal += '';
107
+ if (tens > 0 && tens < 20) { // 1 -> 19
108
+ if (tens === 2 && Math.trunc(hundreds) === 0 && groupLevel > 0) {
109
+ const pow = Math.trunc(Math.log10(Number(this.number)));
110
+ if (pow % 3 === 0 && this.number === 2 * Math.pow(10, pow)) {
111
+ if (groupNumber === 2) {
112
+ retVal = this.arabicTwos[Math.trunc(groupLevel)];
120
113
  } else {
121
- retVal += this.digitFeminineStatus(Math.trunc(tens), groupLevel);
114
+ retVal = this.arabicAppendedTwos[Math.trunc(groupLevel)];
122
115
  }
116
+ } else {
117
+ retVal = this.arabicTwos[Math.trunc(groupLevel)];
123
118
  }
119
+ } else if (tens === 1 && groupLevel > 0) {
120
+ retVal += this.arabicGroup[Math.trunc(groupLevel)];
124
121
  } else {
125
- const ones = tens % 10;
126
- tens = (tens / 10) - 2;
127
-
128
- if (ones > 0) {
129
- if (retVal != '' && tens < 4) {
130
- retVal += ' و ';
131
- }
132
-
133
- retVal += this.digitFeminineStatus(ones, groupLevel);
134
- }
135
- if (retVal != '' && ones != 0) {
136
- retVal += ' و ';
137
- }
138
-
139
- retVal += this.arabicTens[Math.trunc(tens)];
122
+ retVal += this.digitFeminineStatus(Math.trunc(tens), groupLevel);
123
+ }
124
+ } else if (tens >= 20) { // 20 -> 99
125
+ const ones = tens % 10;
126
+ const tensIndex = (tens / 10) - 2;
127
+ if (ones > 0) {
128
+ retVal += this.digitFeminineStatus(ones, groupLevel);
140
129
  }
130
+ if (retVal != '' && ones != 0) {
131
+ retVal += ' و';
132
+ }
133
+ retVal += this.arabicTens[Math.trunc(tensIndex)];
141
134
  }
142
135
 
143
136
  return retVal;
144
137
  }
145
138
 
139
+ /**
140
+ * Converts a number to its cardinal representation in Arabic.
141
+ * It process by blocks of 3 digits.
142
+ * @param {number} number - The number to convert.
143
+ * @returns {string} The cardinal representation of the number in Arabic.
144
+ */
146
145
  toCardinal(number) {
147
146
  if (number == 0) {
148
147
  return this.zero;
@@ -150,30 +149,30 @@ export class Arabic extends AbstractLanguage {
150
149
 
151
150
  this.number = number;
152
151
  let tempNumber = number;
152
+ let tempNumberDec;
153
153
  let group = 0;
154
154
  let retVal = '';
155
155
 
156
156
  // Loop until number has been reduced to zero or less
157
157
  while (tempNumber > 0) {
158
+ tempNumberDec = tempNumber;
158
159
  // Get the remaining value after dividing by 1000
159
- const numberToProcess = Number(tempNumber % 1000n); // Maximum: 999
160
- // Divide number by 1000
161
- tempNumber = tempNumber / 1000n;
160
+ const numberToProcess = Number(tempNumberDec % 1000n); // Maximum: 999
161
+ tempNumber = tempNumberDec / 1000n;
162
162
 
163
163
  // Process "group"
164
- const groupDescription = this.processArabicGroup(numberToProcess, group, tempNumber);
164
+ const groupDescription = this.processArabicGroup(numberToProcess, group);
165
165
 
166
166
  // Did the group return anything?
167
167
  if (groupDescription != '') {
168
- // Is this after the first "group"?
169
- if (group > 0) {
170
- // Is the return value still empty?
168
+ // Is this after the first "group" ? Because nothing is appeded after group 0.
169
+ if (group > 0) { // hundreds, thousands, etc...
170
+ // Is the return value still empty ?
171
171
  if (retVal != '') {
172
- retVal = ' و ' + retVal;
172
+ retVal = ' و' + retVal;
173
173
  }
174
174
 
175
- // Process every number other than 2
176
- if (numberToProcess != 2) {
175
+ if (numberToProcess > 2) {
177
176
  if (numberToProcess % 100 != 1) {
178
177
  if (numberToProcess >= 3 && numberToProcess <= 10) {
179
178
  retVal = this.arabicPluralGroups[group] + ' ' + retVal;
@@ -199,13 +198,16 @@ export class Arabic extends AbstractLanguage {
199
198
  group++;
200
199
  }
201
200
 
201
+ // Replace multiple spaces with one space
202
+ retVal = retVal.replace(/ +/g, ' ');
203
+
202
204
  return retVal.trim();
203
205
  }
204
206
  }
205
207
 
206
208
  /**
207
209
  * Converts a value to cardinal (written) form.
208
- * @param {number|string} value Number to be convert.
210
+ * @param {number|string|bigint} value Number to be convert.
209
211
  * @param {object} [options] Options for class.
210
212
  * @throws {Error} Value cannot be invalid.
211
213
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/az.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Converts a value to cardinal (written) form.
3
- * @param {number|string} value Number to be convert.
3
+ * @param {number|string|bigint} value Number to be convert.
4
4
  * @param {object} [options] Options for class.
5
5
  * @throws {Error} Value cannot be invalid.
6
6
  * @returns {string} Value in cardinal (written) format.
7
7
  */
8
- export default function _default(value: number | string, options?: object): string;
8
+ export default function _default(value: number | string | bigint, options?: object): string;
9
9
  export class N2WordsAZ extends BaseLanguage {
10
10
  constructor(options: any);
11
11
  merge(lPair: any, rPair: any): {
package/lib/i18n/az.js CHANGED
@@ -56,7 +56,7 @@ export class N2WordsAZ extends BaseLanguage {
56
56
 
57
57
  /**
58
58
  * Converts a value to cardinal (written) form.
59
- * @param {number|string} value Number to be convert.
59
+ * @param {number|string|bigint} value Number to be convert.
60
60
  * @param {object} [options] Options for class.
61
61
  * @throws {Error} Value cannot be invalid.
62
62
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/cz.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Converts a value to cardinal (written) form.
3
- * @param {number|string} value Number to be convert.
3
+ * @param {number|string|bigint} value Number to be convert.
4
4
  * @param {object} [options] Options for class.
5
5
  * @throws {Error} Value cannot be invalid.
6
6
  * @returns {string} Value in cardinal (written) format.
7
7
  */
8
- export default function _default(value: number | string, options?: object): string;
8
+ export default function _default(value: number | string | bigint, options?: object): string;
9
9
  export class N2WordsCZ extends N2WordsRU {
10
10
  ones: {
11
11
  1: string;
package/lib/i18n/cz.js CHANGED
@@ -126,7 +126,7 @@ export class N2WordsCZ extends N2WordsRU {
126
126
 
127
127
  /**
128
128
  * Converts a value to cardinal (written) form.
129
- * @param {number|string} value Number to be convert.
129
+ * @param {number|string|bigint} value Number to be convert.
130
130
  * @param {object} [options] Options for class.
131
131
  * @throws {Error} Value cannot be invalid.
132
132
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/de.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Converts a value to cardinal (written) form.
3
- * @param {number|string} value Number to be convert.
3
+ * @param {number|string|bigint} value Number to be convert.
4
4
  * @param {object} [options] Options for class.
5
5
  * @throws {Error} Value cannot be invalid.
6
6
  * @returns {string} Value in cardinal (written) format.
7
7
  */
8
- export default function _default(value: number | string, options?: object): string;
8
+ export default function _default(value: number | string | bigint, options?: object): string;
9
9
  export class N2WordsDE extends BaseLanguage {
10
10
  constructor(options: any);
11
11
  merge(curr: any, next: any): {
package/lib/i18n/de.js CHANGED
@@ -97,7 +97,7 @@ export class N2WordsDE extends BaseLanguage {
97
97
 
98
98
  /**
99
99
  * Converts a value to cardinal (written) form.
100
- * @param {number|string} value Number to be convert.
100
+ * @param {number|string|bigint} value Number to be convert.
101
101
  * @param {object} [options] Options for class.
102
102
  * @throws {Error} Value cannot be invalid.
103
103
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/dk.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Converts a value to cardinal (written) form.
3
- * @param {number|string} value Number to be convert.
3
+ * @param {number|string|bigint} value Number to be convert.
4
4
  * @param {object} [options] Options for class.
5
5
  * @throws {Error} Value cannot be invalid.
6
6
  * @returns {string} Value in cardinal (written) format.
7
7
  */
8
- export default function _default(value: number | string, options?: object): string;
8
+ export default function _default(value: number | string | bigint, options?: object): string;
9
9
  export class N2WordsDK extends BaseLanguage {
10
10
  constructor(options: any);
11
11
  ordFlag: any;
package/lib/i18n/dk.js CHANGED
@@ -100,7 +100,7 @@ export class N2WordsDK extends BaseLanguage {
100
100
 
101
101
  /**
102
102
  * Converts a value to cardinal (written) form.
103
- * @param {number|string} value Number to be convert.
103
+ * @param {number|string|bigint} value Number to be convert.
104
104
  * @param {object} [options] Options for class.
105
105
  * @throws {Error} Value cannot be invalid.
106
106
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/en.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Converts a value to cardinal (written) form.
3
- * @param {number|string} value Number to be convert.
3
+ * @param {number|string|bigint} value Number to be convert.
4
4
  * @param {object} [options] Options for class.
5
5
  * @throws {Error} Value cannot be invalid.
6
6
  * @returns {string} Value in cardinal (written) format.
7
7
  */
8
- export default function _default(value: number | string, options?: object): string;
8
+ export default function _default(value: number | string | bigint, options?: object): string;
9
9
  /**
10
10
  * This class is for converting numbers to english words.
11
11
  */
package/lib/i18n/en.js CHANGED
@@ -76,7 +76,7 @@ export class English extends BaseLanguage {
76
76
 
77
77
  /**
78
78
  * Converts a value to cardinal (written) form.
79
- * @param {number|string} value Number to be convert.
79
+ * @param {number|string|bigint} value Number to be convert.
80
80
  * @param {object} [options] Options for class.
81
81
  * @throws {Error} Value cannot be invalid.
82
82
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/es.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Converts a value to cardinal (written) form.
3
- * @param {number|string} value Number to be convert.
3
+ * @param {number|string|bigint} value Number to be convert.
4
4
  * @param {object} [options] Options for class.
5
5
  * @throws {Error} Value cannot be invalid.
6
6
  * @returns {string} Value in cardinal (written) format.
7
7
  */
8
- export default function _default(value: number | string, options?: object): string;
8
+ export default function _default(value: number | string | bigint, options?: object): string;
9
9
  export class N2WordsES extends BaseLanguage {
10
10
  constructor(options: any);
11
11
  genderStem: any;
package/lib/i18n/es.js CHANGED
@@ -100,7 +100,7 @@ export class N2WordsES extends BaseLanguage {
100
100
 
101
101
  /**
102
102
  * Converts a value to cardinal (written) form.
103
- * @param {number|string} value Number to be convert.
103
+ * @param {number|string|bigint} value Number to be convert.
104
104
  * @param {object} [options] Options for class.
105
105
  * @throws {Error} Value cannot be invalid.
106
106
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/fa.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Converts a value to cardinal (written) form.
3
- * @param {number|string} value Number to be convert.
3
+ * @param {number|string|bigint} value Number to be convert.
4
4
  * @param {object} [options] Options for class.
5
5
  * @throws {Error} Value cannot be invalid.
6
6
  * @returns {string} Value in cardinal (written) format.
7
7
  */
8
- export default function _default(value: number | string, options?: object): string;
8
+ export default function _default(value: number | string | bigint, options?: object): string;
9
9
  export class N2WordsFA extends AbstractLanguage {
10
10
  constructor(options: any);
11
11
  namedNumbers: {
package/lib/i18n/fa.js CHANGED
@@ -96,7 +96,7 @@ export class N2WordsFA extends AbstractLanguage {
96
96
 
97
97
  /**
98
98
  * Converts a value to cardinal (written) form.
99
- * @param {number|string} value Number to be convert.
99
+ * @param {number|string|bigint} value Number to be convert.
100
100
  * @param {object} [options] Options for class.
101
101
  * @throws {Error} Value cannot be invalid.
102
102
  * @returns {string} Value in cardinal (written) format.
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Converts a value to cardinal (written) form.
3
- * @param {number|string} value Number to be convert.
3
+ * @param {number|string|bigint} value Number to be convert.
4
4
  * @param {object} [options] Options for class.
5
5
  * @throws {Error} Value cannot be invalid.
6
6
  * @returns {string} Value in cardinal (written) format.
7
7
  */
8
- export default function _default(value: number | string, options?: object): string;
8
+ export default function _default(value: number | string | bigint, options?: object): string;
9
9
  export class N2WordsFRBE extends N2WordsFR {
10
10
  }
11
11
  import { N2WordsFR } from './fr.js';
package/lib/i18n/fr-BE.js CHANGED
@@ -10,7 +10,7 @@ export class N2WordsFRBE extends N2WordsFR {
10
10
 
11
11
  /**
12
12
  * Converts a value to cardinal (written) form.
13
- * @param {number|string} value Number to be convert.
13
+ * @param {number|string|bigint} value Number to be convert.
14
14
  * @param {object} [options] Options for class.
15
15
  * @throws {Error} Value cannot be invalid.
16
16
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/fr.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Converts a value to cardinal (written) form.
3
- * @param {number|string} value Number to be convert.
3
+ * @param {number|string|bigint} value Number to be convert.
4
4
  * @param {object} [options] Options for class.
5
5
  * @throws {Error} Value cannot be invalid.
6
6
  * @returns {string} Value in cardinal (written) format.
7
7
  */
8
- export default function _default(value: number | string, options?: object): string;
8
+ export default function _default(value: number | string | bigint, options?: object): string;
9
9
  export class N2WordsFR extends BaseLanguage {
10
10
  constructor(options: any);
11
11
  merge(curr: any, next: any): {