n2words 1.18.0 → 1.19.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.
@@ -76,10 +76,10 @@ export default class {
76
76
  const words = [];
77
77
  let allZero = true;
78
78
 
79
- // Split decimal portion into an array of characters in reverse
79
+ // Split decimal portion into an array of characters
80
80
  const chars = decimal.split('');
81
81
 
82
- // Loop through array (from the end) adding leading zeros to output array
82
+ // Loop through characters adding zeros to output array
83
83
  chars.forEach(char => {
84
84
  if (char === '0') {
85
85
  words.push(this.zero);
@@ -88,7 +88,6 @@ export default class {
88
88
  }
89
89
  });
90
90
 
91
- // Add decimal number to word array
92
91
  if (allZero) {
93
92
  return words;
94
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n2words",
3
- "version": "1.18.0",
3
+ "version": "1.19.0",
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.0",
102
+ "core-js": "^3.35.1",
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.0.6",
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.1",
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
  }