Buckets:
| import ascending from "./ascending.js"; | |
| export default function greatest(values, compare = ascending) { | |
| let max; | |
| let defined = false; | |
| if (compare.length === 1) { | |
| let maxValue; | |
| for (const element of values) { | |
| const value = compare(element); | |
| if (defined | |
| ? ascending(value, maxValue) > 0 | |
| : ascending(value, value) === 0) { | |
| max = element; | |
| maxValue = value; | |
| defined = true; | |
| } | |
| } | |
| } else { | |
| for (const value of values) { | |
| if (defined | |
| ? compare(value, max) > 0 | |
| : compare(value, value) === 0) { | |
| max = value; | |
| defined = true; | |
| } | |
| } | |
| } | |
| return max; | |
| } | |
Xet Storage Details
- Size:
- 675 Bytes
- Xet hash:
- ea0b7e12c0b3fa46041c6e6de8130dba2bf033c21b834397bd47c23b5546dbaf
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.