UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

13 lines (8 loc) 276 B
'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const median = require('./median.js'); function medianBy(items, getValue) { const nums = items.map(x => getValue(x)); return median.median(nums); } exports.medianBy = medianBy;