rubico
Version:
[a]synchronous functional programming
10 lines (8 loc) • 1.03 kB
JavaScript
/**
* Rubico v2.8.2
* https://rubico.land/
*
* © Richard Yufei Tong, King of Software
* Rubico may be freely distributed under the CFOSS license.
*/
!function(n,t){"object"==typeof module?module.exports=t:"function"==typeof define?define(()=>t):n.not=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=Array.isArray,t=n=>null!=n&&"function"==typeof n.then,o=Promise.all.bind(Promise),e=Symbol.for("placeholder"),r=n=>!n,u=function(n,o){const e=o(...n);return t(e)?e.then(r):!e};return function(...i){const f=i.pop();return"function"==typeof f?0==i.length?(c=u,s=f,(l=e)==e?((n,t)=>function(...o){return n(o,t)})(c,s):((n,t)=>function(...o){return n(t,o)})(c,l)):function(o){if(n(o)){const n=o.length;let e=-1;for(;++e<n;){const n=o[e];if(t(n))return!0}return!1}for(const n in o){const e=o[n];if(t(e))return!0}return!1}(i)?o(i).then(function(n,t,o){return t==e?((n,t)=>function(o){return n(o,t)})(n,o):((n,t)=>function(o){return n(t,o)})(n,t)}(u,e,f)):u(i,f):t(f)?f.then(r):!f;var c,l,s}}());