n2words 1.18.0 → 1.19.1

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 (65) hide show
  1. package/dist/n2words.js +1 -1
  2. package/dist/n2words.js.map +1 -1
  3. package/lib/classes/AbstractLanguage.d.ts +4 -4
  4. package/lib/classes/AbstractLanguage.js +18 -20
  5. package/lib/classes/BaseLanguage.d.ts +11 -7
  6. package/lib/classes/BaseLanguage.js +13 -6
  7. package/lib/i18n/ar.d.ts +2 -2
  8. package/lib/i18n/ar.js +1 -1
  9. package/lib/i18n/az.d.ts +2 -2
  10. package/lib/i18n/az.js +1 -1
  11. package/lib/i18n/cz.d.ts +2 -2
  12. package/lib/i18n/cz.js +1 -1
  13. package/lib/i18n/de.d.ts +2 -2
  14. package/lib/i18n/de.js +1 -1
  15. package/lib/i18n/dk.d.ts +2 -2
  16. package/lib/i18n/dk.js +1 -1
  17. package/lib/i18n/en.d.ts +2 -2
  18. package/lib/i18n/en.js +1 -1
  19. package/lib/i18n/es.d.ts +2 -2
  20. package/lib/i18n/es.js +1 -1
  21. package/lib/i18n/fa.d.ts +2 -2
  22. package/lib/i18n/fa.js +1 -1
  23. package/lib/i18n/fr-BE.d.ts +2 -2
  24. package/lib/i18n/fr-BE.js +1 -1
  25. package/lib/i18n/fr.d.ts +2 -2
  26. package/lib/i18n/fr.js +1 -1
  27. package/lib/i18n/he.d.ts +2 -2
  28. package/lib/i18n/he.js +1 -1
  29. package/lib/i18n/hr.d.ts +2 -2
  30. package/lib/i18n/hr.js +1 -1
  31. package/lib/i18n/hu.d.ts +2 -2
  32. package/lib/i18n/hu.js +1 -1
  33. package/lib/i18n/id.d.ts +2 -2
  34. package/lib/i18n/id.js +1 -1
  35. package/lib/i18n/it.d.ts +2 -2
  36. package/lib/i18n/it.js +1 -1
  37. package/lib/i18n/ko.d.ts +2 -2
  38. package/lib/i18n/ko.js +1 -1
  39. package/lib/i18n/lt.d.ts +2 -2
  40. package/lib/i18n/lt.js +1 -1
  41. package/lib/i18n/lv.d.ts +2 -2
  42. package/lib/i18n/lv.js +1 -1
  43. package/lib/i18n/nl.d.ts +2 -2
  44. package/lib/i18n/nl.js +1 -1
  45. package/lib/i18n/no.d.ts +2 -2
  46. package/lib/i18n/no.js +1 -1
  47. package/lib/i18n/pl.d.ts +2 -2
  48. package/lib/i18n/pl.js +1 -1
  49. package/lib/i18n/pt.d.ts +2 -2
  50. package/lib/i18n/pt.js +1 -1
  51. package/lib/i18n/ru.d.ts +2 -2
  52. package/lib/i18n/ru.js +1 -1
  53. package/lib/i18n/sr.d.ts +2 -2
  54. package/lib/i18n/sr.js +1 -1
  55. package/lib/i18n/tr.d.ts +2 -2
  56. package/lib/i18n/tr.js +1 -1
  57. package/lib/i18n/uk.d.ts +2 -2
  58. package/lib/i18n/uk.js +1 -1
  59. package/lib/i18n/vi.d.ts +2 -2
  60. package/lib/i18n/vi.js +1 -1
  61. package/lib/i18n/zh.d.ts +2 -2
  62. package/lib/i18n/zh.js +1 -1
  63. package/lib/n2words.d.ts +2 -2
  64. package/lib/n2words.js +3 -3
  65. package/package.json +14 -14
package/lib/i18n/lv.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 N2WordsLV extends N2WordsRU {
10
10
  ones: {
11
11
  1: string;
package/lib/i18n/lv.js CHANGED
@@ -116,7 +116,7 @@ export class N2WordsLV extends N2WordsRU {
116
116
 
117
117
  /**
118
118
  * Converts a value to cardinal (written) form.
119
- * @param {number|string} value Number to be convert.
119
+ * @param {number|string|bigint} value Number to be convert.
120
120
  * @param {object} [options] Options for class.
121
121
  * @throws {Error} Value cannot be invalid.
122
122
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/nl.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 N2WordsNL extends BaseLanguage {
10
10
  constructor(options: any);
11
11
  includeOptionalAnd: any;
package/lib/i18n/nl.js CHANGED
@@ -115,7 +115,7 @@ export class N2WordsNL extends BaseLanguage {
115
115
 
116
116
  /**
117
117
  * Converts a value to cardinal (written) form.
118
- * @param {number|string} value Number to be convert.
118
+ * @param {number|string|bigint} value Number to be convert.
119
119
  * @param {object} [options] Options for class.
120
120
  * @throws {Error} Value cannot be invalid.
121
121
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/no.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 N2WordsNO extends BaseLanguage {
10
10
  constructor(options: any);
11
11
  merge(lPair: any, rPair: any): {
package/lib/i18n/no.js CHANGED
@@ -67,7 +67,7 @@ export class N2WordsNO extends BaseLanguage {
67
67
 
68
68
  /**
69
69
  * Converts a value to cardinal (written) form.
70
- * @param {number|string} value Number to be convert.
70
+ * @param {number|string|bigint} value Number to be convert.
71
71
  * @param {object} [options] Options for class.
72
72
  * @throws {Error} Value cannot be invalid.
73
73
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/pl.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 N2WordsPL extends N2WordsRU {
10
10
  ones: {
11
11
  1: string;
package/lib/i18n/pl.js CHANGED
@@ -117,7 +117,7 @@ export class N2WordsPL extends N2WordsRU {
117
117
 
118
118
  /**
119
119
  * Converts a value to cardinal (written) form.
120
- * @param {number|string} value Number to be convert.
120
+ * @param {number|string|bigint} value Number to be convert.
121
121
  * @param {object} [options] Options for class.
122
122
  * @throws {Error} Value cannot be invalid.
123
123
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/pt.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 N2WordsPT extends BaseLanguage {
10
10
  constructor(options: any);
11
11
  hundreds: {
package/lib/i18n/pt.js CHANGED
@@ -108,7 +108,7 @@ export class N2WordsPT extends BaseLanguage {
108
108
 
109
109
  /**
110
110
  * Converts a value to cardinal (written) form.
111
- * @param {number|string} value Number to be convert.
111
+ * @param {number|string|bigint} value Number to be convert.
112
112
  * @param {object} [options] Options for class.
113
113
  * @throws {Error} Value cannot be invalid.
114
114
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/ru.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 N2WordsRU extends AbstractLanguage {
10
10
  constructor(options: any);
11
11
  /** @type {boolean} */
package/lib/i18n/ru.js CHANGED
@@ -187,7 +187,7 @@ export class N2WordsRU extends AbstractLanguage {
187
187
 
188
188
  /**
189
189
  * Converts a value to cardinal (written) form.
190
- * @param {number|string} value Number to be convert.
190
+ * @param {number|string|bigint} value Number to be convert.
191
191
  * @param {object} [options] Options for class.
192
192
  * @throws {Error} Value cannot be invalid.
193
193
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/sr.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 N2WordsSR extends N2WordsRU {
10
10
  ones: {
11
11
  1: string[];
package/lib/i18n/sr.js CHANGED
@@ -118,7 +118,7 @@ export class N2WordsSR extends N2WordsRU {
118
118
 
119
119
  /**
120
120
  * Converts a value to cardinal (written) form.
121
- * @param {number|string} value Number to be convert.
121
+ * @param {number|string|bigint} value Number to be convert.
122
122
  * @param {object} [options] Options for class.
123
123
  * @throws {Error} Value cannot be invalid.
124
124
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/tr.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 N2WordsTR extends BaseLanguage {
10
10
  constructor(options?: {});
11
11
  merge(lPair: any, rPair: any): {
package/lib/i18n/tr.js CHANGED
@@ -54,7 +54,7 @@ export class N2WordsTR extends BaseLanguage {
54
54
 
55
55
  /**
56
56
  * Converts a value to cardinal (written) form.
57
- * @param {number|string} value Number to be convert.
57
+ * @param {number|string|bigint} value Number to be convert.
58
58
  * @param {object} [options] Options for class.
59
59
  * @throws {Error} Value cannot be invalid.
60
60
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/uk.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 N2WordsUK extends N2WordsRU {
10
10
  ones: {
11
11
  1: string;
package/lib/i18n/uk.js CHANGED
@@ -85,7 +85,7 @@ export class N2WordsUK extends N2WordsRU {
85
85
 
86
86
  /**
87
87
  * Converts a value to cardinal (written) form.
88
- * @param {number|string} value Number to be convert.
88
+ * @param {number|string|bigint} value Number to be convert.
89
89
  * @param {object} [options] Options for class.
90
90
  * @throws {Error} Value cannot be invalid.
91
91
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/vi.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 N2WordsID extends AbstractLanguage {
10
10
  constructor(options: any);
11
11
  base: {
package/lib/i18n/vi.js CHANGED
@@ -145,7 +145,7 @@ export class N2WordsID extends AbstractLanguage {
145
145
 
146
146
  /**
147
147
  * Converts a value to cardinal (written) form.
148
- * @param {number|string} value Number to be convert.
148
+ * @param {number|string|bigint} value Number to be convert.
149
149
  * @param {object} [options] Options for class.
150
150
  * @throws {Error} Value cannot be invalid.
151
151
  * @returns {string} Value in cardinal (written) format.
package/lib/i18n/zh.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 N2WordsZH extends BaseLanguage {
10
10
  constructor(options: any);
11
11
  merge(lPair: any, rPair: any): {
package/lib/i18n/zh.js CHANGED
@@ -68,7 +68,7 @@ export class N2WordsZH extends BaseLanguage {
68
68
 
69
69
  /**
70
70
  * Converts a value to cardinal (written) form.
71
- * @param {number|string} value Number to be convert.
71
+ * @param {number|string|bigint} value Number to be convert.
72
72
  * @param {object} [options] Options for class.
73
73
  * @throws {Error} Value cannot be invalid.
74
74
  * @returns {string} Value in cardinal (written) format.
package/lib/n2words.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Converts a number to written form.
3
- * @param {number|string} value The number to convert.
3
+ * @param {number|string|bigint} value The number to convert.
4
4
  * @param {object} [options] User options.
5
5
  * @returns {string} Value in written format.
6
6
  */
7
- export default function _default(value: number | string, options?: object): string;
7
+ export default function _default(value: number | string | bigint, options?: object): string;
package/lib/n2words.js CHANGED
@@ -33,12 +33,12 @@ const dict = {
33
33
  'cz': n2wordsCZ,
34
34
  'de': n2wordsDE,
35
35
  'dk': n2wordsDK,
36
- 'en': n2wordsEN, // default
36
+ 'en': n2wordsEN, // default
37
37
  'es': n2wordsES,
38
38
  'fa': n2wordsFA,
39
39
  'fr': n2wordsFR,
40
40
  'fr-BE': n2wordsFRBE,
41
- 'he': n2wordsHE, // only for numbers <= 9999
41
+ 'he': n2wordsHE, // currently only for numbers < 10000
42
42
  'hr': n2wordsHR,
43
43
  'hu': n2wordsHU,
44
44
  'id': n2wordsID,
@@ -60,7 +60,7 @@ const dict = {
60
60
 
61
61
  /**
62
62
  * Converts a number to written form.
63
- * @param {number|string} value The number to convert.
63
+ * @param {number|string|bigint} value The number to convert.
64
64
  * @param {object} [options] User options.
65
65
  * @returns {string} Value in written format.
66
66
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n2words",
3
- "version": "1.18.0",
3
+ "version": "1.19.1",
4
4
  "description": "n2words converts a numerical number into a written one, supports 27 languages and has zero dependencies.",
5
5
  "keywords": [
6
6
  "n2words",
@@ -65,7 +65,7 @@
65
65
  "scripts": {
66
66
  "bench": "node bench.js",
67
67
  "build": "webpack --config webpack.config.js --progress",
68
- "build:types": "npx -p typescript tsc lib/n2words.js dist/n2words.js --target es6 --module esnext --allowJs --declaration --emitDeclarationOnly",
68
+ "build:types": "npx -p typescript tsc lib/n2words.js dist/n2words.js --target es6 --module nodenext --allowJs --declaration --emitDeclarationOnly",
69
69
  "coverage": "c8 ava",
70
70
  "lint": "eslint --config .eslintrc.json lib/ test/ examples/ bench.js",
71
71
  "test": "ava --verbose",
@@ -91,26 +91,26 @@
91
91
  ]
92
92
  },
93
93
  "devDependencies": {
94
- "@babel/core": "^7.22.11",
95
- "@babel/preset-env": "^7.22.10",
96
- "ava": "^5.3.1",
94
+ "@babel/core": "^7.23.9",
95
+ "@babel/preset-env": "^7.23.9",
96
+ "ava": "^6.1.1",
97
97
  "babel-loader": "^9.1.3",
98
98
  "benchmark": "^2.1.4",
99
- "c8": "^8.0.1",
99
+ "c8": "^9.1.0",
100
100
  "chalk": "^5.3.0",
101
- "chromedriver": "^116.0.0",
102
- "core-js": "^3.32.1",
103
- "eslint": "^8.48.0",
101
+ "chromedriver": "^121.0.2",
102
+ "core-js": "^3.36.0",
103
+ "eslint": "^8.56.0",
104
104
  "eslint-plugin-ava": "^14.0.0",
105
- "eslint-plugin-import": "^2.28.1",
106
- "eslint-plugin-jsdoc": "^46.5.0",
105
+ "eslint-plugin-import": "^2.29.1",
106
+ "eslint-plugin-jsdoc": "^48.1.0",
107
107
  "eslint-plugin-node": "^11.1.0",
108
108
  "microtime": "^3.1.1",
109
- "selenium-webdriver": "^4.11.1",
110
- "webpack": "^5.88.2",
109
+ "selenium-webdriver": "^4.17.0",
110
+ "webpack": "^5.90.2",
111
111
  "webpack-cli": "^5.1.4"
112
112
  },
113
113
  "engines": {
114
- "node": "16 || 18 || >=20"
114
+ "node": "18 || >=20"
115
115
  }
116
116
  }