UNPKG

remeda

Version:

A utility library for JavaScript and Typescript.

2 lines 467 B
function e(e,t,n){return e(n[0])?e=>t(e,...n):t(...n)}function t(...t){return e(r,n,t)}function n(e,...t){for(let n of t){if(typeof n==`function`)return n(e);let[t,r]=n;if(t(e))return r(e)}throw Error(`conditional: data failed for all cases`)}function r(e){if(!Array.isArray(e))return!1;let[t,n,...r]=e;return typeof t==`function`&&t.length<=1&&typeof n==`function`&&n.length<=1&&r.length===0}export{t as conditional}; //# sourceMappingURL=conditional-BdGnwdZr.js.map