MultiLoader-Template/node_modules/es-toolkit/dist/compat/math/max.mjs
3944Realms 768f38fc97 feat: 可使用的构建模板
修改了脚本,使其可以推给Maven仓库
2026-05-03 13:02:19 +08:00

19 lines
475 B
JavaScript

function max(items) {
if (!items || items.length === 0) {
return undefined;
}
let maxResult = undefined;
for (let i = 0; i < items.length; i++) {
const current = items[i];
if (current == null || Number.isNaN(current) || typeof current === 'symbol') {
continue;
}
if (maxResult === undefined || current > maxResult) {
maxResult = current;
}
}
return maxResult;
}
export { max };