@hestia-earth/utils 0.13.25 → 0.13.26

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/dist/number.d.ts CHANGED
@@ -78,3 +78,4 @@ export declare const sum: (values?: number[]) => number;
78
78
  export declare const mean: (values?: number[]) => number;
79
79
  export declare const min: (values: number[]) => any;
80
80
  export declare const max: (values: number[]) => any;
81
+ export declare const median: (values: number[]) => number;
package/dist/number.js CHANGED
@@ -17,7 +17,7 @@ var __read = (this && this.__read) || function (o, n) {
17
17
  };
18
18
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.max = exports.min = exports.mean = exports.sum = exports.convertValue = exports.converters = exports.ConvertUnits = exports.toComma = exports.toPrecision = exports.isNumber = void 0;
20
+ exports.median = exports.max = exports.min = exports.mean = exports.sum = exports.convertValue = exports.converters = exports.ConvertUnits = exports.toComma = exports.toPrecision = exports.isNumber = void 0;
21
21
  /**
22
22
  * Check if the value is a number.
23
23
  *
@@ -205,3 +205,5 @@ var min = function (values) { return Math.min.apply(Math.min, values); };
205
205
  exports.min = min;
206
206
  var max = function (values) { return Math.max.apply(Math.max, values); };
207
207
  exports.max = max;
208
+ var median = function (values) { return values.sort()[Math.round(values.length / 2)]; };
209
+ exports.median = median;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/utils",
3
- "version": "0.13.25",
3
+ "version": "0.13.26",
4
4
  "description": "HESTIA Utils library",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",