@hestia-earth/utils 0.10.22 → 0.10.23

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 (2) hide show
  1. package/dist/term.js +1 -1
  2. package/package.json +1 -1
package/dist/term.js CHANGED
@@ -5,7 +5,7 @@ var glossary_1 = require("@hestia-earth/glossary");
5
5
  var utils_1 = require("./utils");
6
6
  var arrayValue = function (values, isAverage) {
7
7
  if (isAverage === void 0) { isAverage = false; }
8
- return (values || []).reduce(function (prev, curr) { return prev + parseFloat("" + curr); }, 0) / (isAverage ? values.length : 1);
8
+ return (values || []).reduce(function (prev, curr) { return prev + (utils_1.isEmpty(curr) ? 0 : parseFloat("" + curr)); }, 0) / (isAverage ? values.filter(function (v) { return !utils_1.isEmpty(v); }).length : 1);
9
9
  };
10
10
  exports.arrayValue = arrayValue;
11
11
  var propertyValue = function (value, termId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/utils",
3
- "version": "0.10.22",
3
+ "version": "0.10.23",
4
4
  "description": "Hestia Utils library",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",