@reactivex/ix-esnext-esm
Version:
The Interactive Extensions for JavaScript
1 lines • 880 B
Source Map (JSON)
{"version":3,"sources":["add/iterable-operators/maxby.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvD;;GAEG;AACH,MAAM,UAAU,UAAU,CAExB,KAA2B,EAC3B,GAAkC;IAElC,OAAO,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,CAAC","file":"maxby.js","sourcesContent":["import { IterableX } from '../../iterable/iterablex';\nimport { maxBy } from '../../iterable/operators/maxby';\n\n/**\n * @ignore\n */\nexport function maxByProto<TSource, TKey>(\n this: IterableX<TSource>,\n keyFn: (x: TSource) => TKey,\n cmp?: (x: TKey, y: TKey) => number\n): IterableX<TSource> {\n return maxBy(keyFn, cmp)(this);\n}\n\nIterableX.prototype.maxBy = maxByProto;\n\ndeclare module '../../iterable/iterablex' {\n interface IterableX<T> {\n maxBy: typeof maxByProto;\n }\n}\n"]}