Files
lan-manager/web/node_modules/@antv/util/lib/min.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

29 lines
711 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var is_array_1 = require("./is-array");
/**
* @param {Array} arr The array to iterate over.
* @return {*} Returns the minimum value.
* @example
*
* min([1, 2]);
* // => 1
*
* min([]);
* // => undefined
*
* const data = new Array(1250010).fill(1).map((d,idx) => idx);
*
* min(data);
* // => 1250010
* // Math.min(...data) will encounter "Maximum call stack size exceeded" error
*/
exports.default = (function (arr) {
if (!is_array_1.default(arr)) {
return undefined;
}
return arr.reduce(function (prev, curr) {
return Math.min(prev, curr);
}, arr[0]);
});
//# sourceMappingURL=min.js.map