UNPKG

moltres-utils

Version:
51 lines (40 loc) 1.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; require("core-js/modules/es6.object.define-property"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var XWrap = /*#__PURE__*/ function () { function XWrap(fn) { _classCallCheck(this, XWrap); this.f = fn; } _createClass(XWrap, [{ key: '@@transducer/init', value: function transducerInit() { throw new Error('init not implemented on XWrap'); } }, { key: '@@transducer/result', value: function transducerResult(acc) { return acc; } }, { key: '@@transducer/step', value: function transducerStep(acc, x) { return this.f(acc, x); } }]); return XWrap; }(); var xwrap = function xwrap(fn) { return new XWrap(fn); }; var _default = xwrap; exports.default = _default; //# sourceMappingURL=xwrap.js.map