-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxoox.min.js
1 lines (1 loc) · 1.18 KB
/
xoox.min.js
1
var x=function(){"use strict";var t=(...t)=>(e,...n)=>t.reverse().reduce((t,e)=>e(t,...n),e),e=(e,...c)=>{const u=o((e[Symbol.asyncIterator]||e[Symbol.iterator]||r(e)).call(e));return n(u,t(...c)(t=>u.out=t,u))};const n=(t,e,o=t.next())=>{if(o.then)return o.then(o=>n(t,e,o));for(;!o.done&&!t.done;){const r=e(o.value);if(r&&r.then&&!r.next)return r.then(()=>n(t,e));if((o=t.next()).then)return o.then(o=>n(t,e,o))}return t.out},o=t=>(t.stopped=new Promise(e=>{t.stop=(()=>!t.done&&(t.done=!0)&&t.return&&e(t.return()))}),t),r=t=>t.constructor==Object?function*(){for(entry of Object.entries(this))yield entry}:t.constructor==Function?function*(){for(;;)yield this()}:t.constructor==Number?function*(t=0){for(;t++<this;)yield t}:0;var c=t=>(e,n)=>t&&t.then?(t.then(n.stop),e):t&&t.each?(t.each(n.stop),e):o=>"number"==typeof t?(--t<=0&&n.stop(),t>=0&&e(o)):"function"==typeof t?t(o)?n.stop():e(o):0,u=x=e;return x.pipe=x.x=x,x.compose=t,x.map=(t=>e=>n=>e(t(n))),x.until=c,x.reduce=((t,e)=>n=>o=>null!=t&&n(t.next?t.next(o):t.call?e=t(e,o):t.push?(t.push(o),t):t.concat?t=t.concat(o):t.toFixed?t+=o:(t[o[0]]=o[1],t))),x.filter=(t=>e=>n=>t(n)&&e(n)),x.flatten=((t,n)=>o=>{e(o,c(n.stopped),()=>e=>t(e))}),u}();