source: node_modules/ramda/src/internal/_xuniqBy.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 665 bytes
Line 
1var _Set =
2/*#__PURE__*/
3require("./_Set.js");
4
5var _xfBase =
6/*#__PURE__*/
7require("./_xfBase.js");
8
9var XUniqBy =
10/*#__PURE__*/
11function () {
12 function XUniqBy(f, xf) {
13 this.xf = xf;
14 this.f = f;
15 this.set = new _Set();
16 }
17
18 XUniqBy.prototype['@@transducer/init'] = _xfBase.init;
19 XUniqBy.prototype['@@transducer/result'] = _xfBase.result;
20
21 XUniqBy.prototype['@@transducer/step'] = function (result, input) {
22 return this.set.add(this.f(input)) ? this.xf['@@transducer/step'](result, input) : result;
23 };
24
25 return XUniqBy;
26}();
27
28function _xuniqBy(f) {
29 return function (xf) {
30 return new XUniqBy(f, xf);
31 };
32}
33
34module.exports = _xuniqBy;
Note: See TracBrowser for help on using the repository browser.