@hestia-earth/utils 0.13.24 → 0.13.25
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 +2 -0
- package/dist/number.js +6 -2
- package/package.json +1 -1
package/dist/number.d.ts
CHANGED
|
@@ -76,3 +76,5 @@ export declare const converters: {
|
|
|
76
76
|
export declare const convertValue: (n: number, fromUnit: ConvertUnits, toUnit: ConvertUnits, args?: IConvertArgs) => number;
|
|
77
77
|
export declare const sum: (values?: number[]) => number;
|
|
78
78
|
export declare const mean: (values?: number[]) => number;
|
|
79
|
+
export declare const min: (values: number[]) => any;
|
|
80
|
+
export declare const max: (values: number[]) => any;
|
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.mean = exports.sum = exports.convertValue = exports.converters = exports.ConvertUnits = exports.toComma = exports.toPrecision = exports.isNumber = void 0;
|
|
20
|
+
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
|
*
|
|
@@ -198,6 +198,10 @@ var sum = function (values) {
|
|
|
198
198
|
exports.sum = sum;
|
|
199
199
|
var mean = function (values) {
|
|
200
200
|
if (values === void 0) { values = []; }
|
|
201
|
-
return (values === null || values === void 0 ? void 0 : values.length) ? exports.sum(values) / values.length : 0;
|
|
201
|
+
return ((values === null || values === void 0 ? void 0 : values.length) ? exports.sum(values) / values.length : 0);
|
|
202
202
|
};
|
|
203
203
|
exports.mean = mean;
|
|
204
|
+
var min = function (values) { return Math.min.apply(Math.min, values); };
|
|
205
|
+
exports.min = min;
|
|
206
|
+
var max = function (values) { return Math.max.apply(Math.max, values); };
|
|
207
|
+
exports.max = max;
|