@razorpay/blade
Version:
The Design System that powers Razorpay
33 lines (26 loc) • 879 B
JavaScript
import { getDefaultExportFromCjs } from '../../../../_virtual/_commonjsHelpers.js';
import { __exports as maxBy$1 } from '../../../../_virtual/maxBy4.js';
(function (exports) {
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function maxBy(items, getValue) {
if (items.length === 0) {
return undefined;
}
let maxElement = items[0];
let max = getValue(maxElement, 0, items);
for (let i = 1; i < items.length; i++) {
const element = items[i];
const value = getValue(element, i, items);
if (value > max) {
max = value;
maxElement = element;
}
}
return maxElement;
}
exports.maxBy = maxBy;
} (maxBy$1));
var maxBy = /*@__PURE__*/getDefaultExportFromCjs(maxBy$1);
export { maxBy as default };
//# sourceMappingURL=maxBy.js.map