swc/crates/swc_bundler/tests/.cache/deno/8e84fb8a7c5b83ee72d199d3112ff89b01713798.ts
2021-11-09 20:42:49 +09:00

28 lines
792 B
TypeScript

// Loaded from https://deno.land/x/ramda@v0.27.2/source/internal/_xfindLastIndex.js
import _curry2 from './_curry2.js';
import _xfBase from './_xfBase.js';
function XFindLastIndex(f, xf) {
this.xf = xf;
this.f = f;
this.idx = -1;
this.lastIdx = -1;
}
XFindLastIndex.prototype['@@transducer/init'] = _xfBase.init;
XFindLastIndex.prototype['@@transducer/result'] = function(result) {
return this.xf['@@transducer/result'](this.xf['@@transducer/step'](result, this.lastIdx));
};
XFindLastIndex.prototype['@@transducer/step'] = function(result, input) {
this.idx += 1;
if (this.f(input)) {
this.lastIdx = this.idx;
}
return result;
};
var _xfindLastIndex = _curry2(function _xfindLastIndex(f, xf) { return new XFindLastIndex(f, xf); });
export default _xfindLastIndex;