Comparing version 0.13.0 to 0.14.0
@@ -1,2 +0,2 @@ | ||
// Ramda v0.13.0 | ||
// Ramda v0.14.0 | ||
// https://github.com/ramda/ramda | ||
@@ -6,2 +6,3 @@ // (c) 2013-2015 Scott Sauyet, Michael Hurley, and David Chambers | ||
(function(){"use strict";var n={ramda:"placeholder"},t=function(n,t){return n+t},r=function(n,t){for(var r=-1;++r<t.length;)if(!n(t[r]))return!1;return!0},e=function(n,t){for(var r=-1;++r<t.length;)if(n(t[r]))return!0;return!1},u=function(n,t,r){var e={};for(var u in r)e[u]=r[u];return e[n]=t,e},i=function(n){return new RegExp(n.source,(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":""))},o=function(n){return function(){return!n.apply(this,arguments)}},f=function(n,t){return function(){return n.call(this,t.apply(this,arguments))}},c=function(n,t){n=n||[],t=t||[];var r,e=n.length,u=t.length,i=[];for(r=-1;++r<e;)i[i.length]=n[r];for(r=-1;++r<u;)i[i.length]=t[r];return i},a=function(n,t,r){for(var e=-1,u=r.length;++e<u;)if(n(t,r[e]))return!0;return!1},s=function(n,t){var r={};return r[n]=t,r},l=function(n){return function(t,r){if(r&&r.length>0){for(var e,u=0,i=r[u],o=t(i);++u<r.length;)e=t(r[u]),n(e,o)&&(o=e,i=r[u]);return i}}},h=function(t){return function r(e){return 0===arguments.length?r:e===n?r:t(e)}},p=function(t){return function r(e,u){var i=arguments.length;return 0===i?r:1===i&&e===n?r:1===i?h(function(n){return t(e,n)}):2===i&&e===n&&u===n?r:2===i&&e===n?h(function(n){return t(n,u)}):2===i&&u===n?h(function(n){return t(e,n)}):t(e,u)}},g=function(t){return function r(e,u,i){var o=arguments.length;return 0===o?r:1===o&&e===n?r:1===o?p(function(n,r){return t(e,n,r)}):2===o&&e===n&&u===n?r:2===o&&e===n?p(function(n,r){return t(n,u,r)}):2===o&&u===n?p(function(n,r){return t(e,n,r)}):2===o?h(function(n){return t(e,u,n)}):3===o&&e===n&&u===n&&i===n?r:3===o&&e===n&&u===n?p(function(n,r){return t(n,r,i)}):3===o&&e===n&&i===n?p(function(n,r){return t(n,u,r)}):3===o&&u===n&&i===n?p(function(n,r){return t(e,n,r)}):3===o&&e===n?h(function(n){return t(n,u,i)}):3===o&&u===n?h(function(n){return t(e,n,i)}):3===o&&i===n?h(function(n){return t(e,u,n)}):t(e,u,i)}},y=function(n,t){var r={};for(var e in t)e!==n&&(r[e]=t[e]);return r},m=function(n,t){for(var r=-1,e=t.length,u=[];++r<e;)n(t[r])&&(u[u.length]=t[r]);return u},v=function(n,t){for(var r=-1,e=t.length,u=[];++r<e;)n(t[r],r,t)&&(u[u.length]=t[r]);return u},d=function(n,t){for(var r=-1,e=t.length;++r<e;)n(t[r]);return t},x=function(n){return function(t){return m(function(n){return"function"==typeof t[n]},n(t))}},w=function(n,t){return n>t},b=function(n,t){return Object.prototype.hasOwnProperty.call(t,n)},j=function(n){return n},O=function(n,t,r){var e=0,u=n.length;for("number"==typeof r&&(e=0>r?Math.max(0,u+r):r);u>e;){if(n[e]===t)return e;++e}return-1},_=Array.isArray||function(n){return null!=n&&n.length>=0&&"[object Array]"===Object.prototype.toString.call(n)},I=Number.isInteger||function(n){return n<<0===n},A=function(n){return null!=n&&n===Object(n)&&"function"==typeof n.then},k=function(n){return"function"==typeof n.step&&"function"==typeof n.result},E=function(n,t,r){var e=n.length;for("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1));--e>=0;)if(n[e]===t)return e;return-1},P=function(n,t){return t>n},C=function(n,t){for(var r=-1,e=t.length,u=[];++r<e;)u[r]=n(t[r]);return u},M=function(n,t){return n*t},S=function(n,t){return 0>n?t[t.length+n]:t[n]},W=function(n,t){if(null!=t&&0!==n.length){for(var r=t,e=0,u=n.length;u>e&&null!=r;e+=1)r=r[n[e]];return r}},N=function(n,t){return c([n],t)},R=function(n){return n&&n.__transducers_reduced__?n:{value:n,__transducers_reduced__:!0}},L=function(n,t,r){if(n===r)return!0;if(null==r)return!1;t.fn=t.fn||[],t.obj=t.obj||[];for(var e,u,i=-1,o=t.fn.length,f=-1,c=t.obj.length;++i<o;){if(e=t.fn[i],u=n[e],!(e in r))return!1;if(!u(r[e],r))return!1}for(;++f<c;)if(e=t.obj[f],n[e]!==r[e])return!1;return!0},T=function lu(n,t,r){switch(arguments.length){case 1:return lu(n,0,n.length);case 2:return lu(n,t,n.length);default:for(var e=Math.max(0,r-t),u=[],i=-1;++i<e;)u[i]=n[t+i];return u}},q=function(){function n(n,t){this.xf=t,this.f=n,this.all=!0}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.all&&(n=this.xf.step(n,!0)),this.xf.result(n)},n.prototype.step=function(n,t){return this.f(t)||(this.all=!1,n=R(this.xf.step(n,!1))),n},p(function(t,r){return new n(t,r)})}(),B=function(){function n(n,t){this.xf=t,this.f=n,this.any=!1}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.any||(n=this.xf.step(n,!1)),this.xf.result(n)},n.prototype.step=function(n,t){return this.f(t)&&(this.any=!0,n=R(this.xf.step(n,!0))),n},p(function(t,r){return new n(t,r)})}(),z=function(){function n(n,t){this.xf=t,this.n=n}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.xf.result(n)},n.prototype.step=function(n,t){return this.n>0?(this.n-=1,n):this.xf.step(n,t)},p(function(t,r){return new n(t,r)})}(),D=function(){function n(n,t){this.xf=t,this.f=n}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.xf.result(n)},n.prototype.step=function(n,t){if(this.f){if(this.f(t))return n;this.f=null}return this.xf.step(n,t)},p(function(t,r){return new n(t,r)})}(),F=function(){function n(n,t){this.xf=t,this.f=n}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.xf.result(n)},n.prototype.step=function(n,t){return this.f(t)?this.xf.step(n,t):n},p(function(t,r){return new n(t,r)})}(),U=function(){function n(n,t){this.xf=t,this.f=n,this.found=!1}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.found||(n=this.xf.step(n,void 0)),this.xf.result(n)},n.prototype.step=function(n,t){return this.f(t)&&(this.found=!0,n=R(this.xf.step(n,t))),n},p(function(t,r){return new n(t,r)})}(),X=function(){function n(n,t){this.xf=t,this.f=n,this.idx=-1,this.found=!1}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.found||(n=this.xf.step(n,-1)),this.xf.result(n)},n.prototype.step=function(n,t){return this.idx+=1,this.f(t)&&(this.found=!0,n=R(this.xf.step(n,this.idx))),n},p(function(t,r){return new n(t,r)})}(),$=function(){function n(n,t){this.xf=t,this.f=n}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.xf.result(this.xf.step(n,this.last))},n.prototype.step=function(n,t){return this.f(t)&&(this.last=t),n},p(function(t,r){return new n(t,r)})}(),G=function(){function n(n,t){this.xf=t,this.f=n,this.idx=-1,this.lastIdx=-1}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.xf.result(this.xf.step(n,this.lastIdx))},n.prototype.step=function(n,t){return this.idx+=1,this.f(t)&&(this.lastIdx=this.idx),n},p(function(t,r){return new n(t,r)})}(),H=function(){function n(n,t){this.xf=t,this.f=n}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.xf.result(n)},n.prototype.step=function(n,t){return this.xf.step(n,this.f(t))},p(function(t,r){return new n(t,r)})}(),J=function(){function n(n,t){this.xf=t,this.n=n}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.xf.result(n)},n.prototype.step=function(n,t){return this.n-=1,0===this.n?R(this.xf.step(n,t)):this.xf.step(n,t)},p(function(t,r){return new n(t,r)})}(),K=function(){function n(n,t){this.xf=t,this.f=n}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){return this.xf.result(n)},n.prototype.step=function(n,t){return this.f(t)?this.xf.step(n,t):R(n)},p(function(t,r){return new n(t,r)})}(),Q=function(){function n(n){this.f=n}return n.prototype.init=function(){throw new Error("init not implemented on XWrap")},n.prototype.result=function(n){return n},n.prototype.step=function(n,t){return this.f(n,t)},function(t){return new n(t)}}(),V=p(t),Y=h(function(n){return function(){return n}}),Z=p(function(n,t){return n&&t}),nn=p(function(n,t){for(var r=-1,e=t.length-(n-1),u=new Array(e>=0?e:0);++r<e;)u[r]=T(t,r,r+n);return u}),tn=p(function(n,t){return n.apply(this,t)}),rn=p(function(n,t){switch(n){case 0:return function(){return t.apply(this,arguments)};case 1:return function(n){return t.apply(this,arguments)};case 2:return function(n,r){return t.apply(this,arguments)};case 3:return function(n,r,e){return t.apply(this,arguments)};case 4:return function(n,r,e,u){return t.apply(this,arguments)};case 5:return function(n,r,e,u,i){return t.apply(this,arguments)};case 6:return function(n,r,e,u,i,o){return t.apply(this,arguments)};case 7:return function(n,r,e,u,i,o,f){return t.apply(this,arguments)};case 8:return function(n,r,e,u,i,o,f,c){return t.apply(this,arguments)};case 9:return function(n,r,e,u,i,o,f,c,a){return t.apply(this,arguments)};case 10:return function(n,r,e,u,i,o,f,c,a,s){return t.apply(this,arguments)};default:throw new Error("First argument to arity must be a non-negative integer no greater than ten")}}),en=g(u),un=p(function(n,t){return rn(n.length,function(){return n.apply(t,arguments)})}),on=p(function(n,t){return function(){return n.apply(this,arguments)&&t.apply(this,arguments)}}),fn=h(function(n){return function(t,r){return n(t,r)?-1:n(r,t)?1:0}}),cn=h(o),an=function(){var n=arguments;return function(){for(var t=-1;++t<n.length;)if(n[t][0].apply(this,arguments))return n[t][1].apply(this,arguments)}},sn=g(a),ln=p(function(n,t){for(var r={},e=t.length,u=-1;++u<e;){var i=n(t[u]);r[i]=(b(i,r)?r[i]:0)+1}return r}),hn=p(s),pn=p(function hu(t,r){return rn(t,function(){for(var e=arguments.length,u=t-e,i=e;--i>=0;)arguments[i]===n&&(u+=1);if(0>=u)return r.apply(this,arguments);var o=T(arguments);return hu(u,function(){for(var t=T(arguments),u=[],i=-1;++i<e;){var f=o[i];u[i]=f===n?t.shift():f}return r.apply(this,u.concat(t))})})}),gn=V(-1),yn=p(function(n,t){return null==t?n:t}),mn=g(function(n,t,r){for(var e=[],u=-1,i=t.length,o=sn(n);++u<i;)o(t[u],r)||o(t[u],e)||(e[u]=t[u]);return e}),vn=p(y),dn=p(function(n,t){return n/t}),xn=p(function(n,t){return function(){return n.apply(this,arguments)||t.apply(this,arguments)}}),wn=p(function(n,t){return 0===n?1/n===1/t:n===t||n!==n&&t!==t}),bn=g(function(n,t,r){return t[n]===r[n]}),jn=p(v),On=p(d),_n=p(function(n,t){for(var r=-1,e=t.length;++r<e;)n(t[r],r,t);return t}),In=h(function(n){for(var t=-1,r=n.length,e={};++t<r;)_(n[t])&&n[t].length&&(e[n[t][0]]=n[t][1]);return e}),An=p(w),kn=p(function(n,t){return n>=t}),En=p(b),Pn=p(function(n,t){return n in t}),Cn=h(j),Mn=g(function(n,t,r){return pn(Math.max(n.length,t.length,r.length),function(){return n.apply(this,arguments)?t.apply(this,arguments):r.apply(this,arguments)})}),Sn=V(1),Wn=p(function(n,t){return O(t,n)}),Nn=g(function(n,t,r){return n=n<r.length&&n>=0?n:r.length,c(c(T(r,0,n),t),T(r,n))}),Rn=p(function(n,t){return null!=t&&t.constructor===n||t instanceof n}),Ln=h(function(n){return _(n)?!0:n?"object"!=typeof n?!1:n instanceof String?!1:1===n.nodeType?!!n.length:0===n.length?!0:n.length>0?n.hasOwnProperty(0)&&n.hasOwnProperty(n.length-1):!1:!1}),Tn=h(function(n){return 0===Object(n).length}),qn=h(function(n){return"number"==typeof n&&n!==n}),Bn=h(function(n){return null==n}),zn=h(function(n){for(var t=n.length,r=-1;++r<t;)if(O(n,n[r],r+1)>=0)return!1;return!0}),Dn=h(function(n){var t,r=[];for(t in n)r[r.length]=t;return r}),Fn=p(function(n,t){return E(t,n)}),Un=h(function(n){return null!=n&&Rn(Number,n.length)?n.length:0/0}),Xn=p(function(n,t){var r=function(t){return n(t)};return r.set=p(t),r.map=p(function(r,e){return t(r(n(e)),e)}),r}),$n=g(function(n,t,r){var e=function(){return n(r)};return e.set=t,e.map=function(e){return t(e(n(r)))},e}),Gn=p(P),Hn=p(function(n,t){return t>=n}),Jn=g(function(n,t,r){for(var e=-1,u=r.length,i=[],o=[t];++e<u;)o=n(o[0],r[e]),i[e]=o[1];return[o[0],i]}),Kn=g(function(n,t,r){for(var e=r.length,u=[],i=[t];--e>=0;)i=n(i[0],r[e]),u[e]=i[1];return[i[0],u]}),Qn=p(function(n,t){for(var r=-1,e=t.length,u=[];++r<e;)u[r]=n(t[r],r,t);return u}),Vn=p(function(n,t){return I(n)?!I(t)||1>t?0/0:(n%t+t)%t:0/0}),Yn=p(l(w)),Zn=function(){var n=function(n){return n+"::"+Object.prototype.toString.call(n)},t=function(t){return t.length+":{"+C(n,t).join(",")+"}"};return h(function(n){var r={};return function(){var e=t(arguments);return b(e,r)||(r[e]=n.apply(this,arguments)),r[e]}})}(),nt=p(l(P)),tt=p(function(n,t){return n%t}),rt=p(M),et=p(function(n,t){switch(n){case 0:return function(){return t.call(this)};case 1:return function(n){return t.call(this,n)};case 2:return function(n,r){return t.call(this,n,r)};case 3:return function(n,r,e){return t.call(this,n,r,e)};case 4:return function(n,r,e,u){return t.call(this,n,r,e,u)};case 5:return function(n,r,e,u,i){return t.call(this,n,r,e,u,i)};case 6:return function(n,r,e,u,i,o){return t.call(this,n,r,e,u,i,o)};case 7:return function(n,r,e,u,i,o,f){return t.call(this,n,r,e,u,i,o,f)};case 8:return function(n,r,e,u,i,o,f,c){return t.call(this,n,r,e,u,i,o,f,c)};case 9:return function(n,r,e,u,i,o,f,c,a){return t.call(this,n,r,e,u,i,o,f,c,a)};case 10:return function(n,r,e,u,i,o,f,c,a,s){return t.call(this,n,r,e,u,i,o,f,c,a,s)};default:throw new Error("First argument to nAry must be a non-negative integer no greater than ten")}}),ut=h(function(n){return-n}),it=h(function(n){return!n}),ot=p(S),ft=h(function(n){return function(){return S(n,arguments)}}),ct=p(function(n,t){return t.charAt(0>n?t.length+n:n)}),at=p(function(n,t){return t.charCodeAt(0>n?t.length+n:n)}),st=h(function(n){return[n]}),lt=p(function(n,t){var r={};for(var e in t)O(n,e)<0&&(r[e]=t[e]);return r}),ht=h(function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments))}}),pt=p(function(n,t){return n||t}),gt=p(W),yt=g(function(n,t,r){return W(n,r)===t}),mt=p(function(n,t){var r={};for(var e in t)O(n,e)>=0&&(r[e]=t[e]);return r}),vt=p(function(n,t){for(var r={},e=-1,u=n.length;++e<u;){var i=n[e];r[i]=t[i]}return r}),dt=p(function(n,t){var r={};for(var e in t)n(t[e],e,t)&&(r[e]=t[e]);return r}),xt=p(N),wt=p(function(n,t){return t[n]}),bt=g(function(n,t,r){return r[n]===t}),jt=g(function(n,t,r){return b(t,r)?r[t]:n}),Ot=p(function(n,t){for(var r=n.length,e=[],u=-1;++u<r;)e[u]=t[n[u]];return e}),_t=p(function(n,t){for(var r=[],e=n;t>e;)r[r.length]=e,e+=1;return r}),It=g(function(n,t,r){for(var e=-1,u=r.length;++e<u;)t=n(t,r[e],e,r);return t}),At=g(function(n,t,r){for(var e=r.length;--e>=0;)t=n(t,r[e]);return t}),kt=g(function(n,t,r){for(var e=r.length;--e>=0;)t=n(t,r[e],e,r);return t}),Et=p(function(n,t){return v(o(n),t)}),Pt=g(function(n,t,r){return c(T(r,0,Math.min(n,r.length)),T(r,Math.min(r.length,n+t)))}),Ct=g(function(n,t,r){return r.replace(n,t)}),Mt=h(function(n){return T(n).reverse()}),St=g(function(n,t,r){for(var e=0,u=r.length+1,i=[t];++e<u;)t=n(t,r[e-1]),i[e]=t;return i}),Wt=p(function(n,t){return T(t).sort(function(t,r){var e=n(t),u=n(r);return u>e?-1:e>u?1:0})}),Nt=p(function(n,t){return t.indexOf(n)}),Rt=p(function(n,t){return t.lastIndexOf(n)}),Lt=p(function(n,t){return n-t}),Tt=p(function(n,t){return n(t),t}),qt=p(function(n,t){return i(n).test(t)}),Bt=p(function(n,t){for(var r=Number(t),e=new Array(r),u=0;r>u;)e[u]=n(u),u+=1;return e}),zt=h(function(n){var t=[];for(var r in n)b(r,n)&&(t[t.length]=[r,n[r]]);return t}),Dt=h(function(n){var t=[];for(var r in n)t[t.length]=[r,n[r]];return t}),Ft=function(){var n=" \n\f\r \u2028\u2029\ufeff",t="",r="function"==typeof String.prototype.trim;return h(r&&!n.trim()&&t.trim()?function(n){return n.trim()}:function(t){var r=new RegExp("^["+n+"]["+n+"]*"),e=new RegExp("["+n+"]["+n+"]*$");return t.replace(r,"").replace(e,"")})}(),Ut=h(function(n){return null===n?"Null":void 0===n?"Undefined":Object.prototype.toString.call(n).slice(8,-1)}),Xt=h(function(n){return function(){return n(T(arguments))}}),$t=h(function(n){return et(1,n)}),Gt=p(function(n,t){for(var r=n(t),e=[];r&&r.length;)e[e.length]=r[0],r=n(r[1]);return e}),Ht=p(function(n,t){for(var r,e=-1,u=t.length,i=[];++e<u;)r=t[e],a(n,r,i)||(i[i.length]=r);return i}),Jt=h(function(n){var t,r=[];for(t in n)r[r.length]=n[t];return r}),Kt=p(function(n,t){return pn(n.length,function(){return t.apply(this,c([n],arguments))})}),Qt=p(function(n,t){for(var r,e=-1,u=n.length,i=t.length,o=[];++e<u;)for(r=-1;++r<i;)o[o.length]=[n[e],t[r]];return o}),Vt=p(function(n,t){for(var r=[],e=-1,u=Math.min(n.length,t.length);++e<u;)r[e]=[n[e],t[e]];return r}),Yt=p(function(n,t){for(var r=-1,e=n.length,u={};++r<e;)u[n[r]]=t[r];return u}),Zt=g(function(n,t,r){for(var e=[],u=-1,i=Math.min(t.length,r.length);++u<i;)e[u]=n(t[u],r[u]);return e}),nr=Y(!1),tr=Y(!0),rr=function(n,t){return c(t,[n])},er=function pu(n,t,r){switch(n.length){case 0:return r;case 1:return u(n[0],t,r);default:return u(n[0],pu(T(n,1),t,Object(r[n[0]])),r)}},ur=function gu(n,t,r){var e=function(e){for(var u=t.length,i=-1;++i<u;)if(n===t[i])return r[i];t[i+1]=n,r[i+1]=e;for(var o in n)e[o]=gu(n[o],t,r);return e};switch(Ut(n)){case"Object":return e({});case"Array":return e([]);case"Date":return new Date(n);case"RegExp":return i(n);default:return n}},ir=function(n,t){return function(){var r=arguments.length;if(0===r)return t();var e=arguments[r-1];return _(e)||"function"!=typeof e[n]?t.apply(this,arguments):e[n].apply(e,T(arguments,0,r-1))}},or=function(n,t){return function(){var r=this,e=t.apply(this,arguments);return A(e)?e.then(function(t){return n.call(r,t)}):n.call(this,e)}},fr=function(n,t){return O(t,n)>=0},cr=function(n){return function(){for(var t=arguments.length-1,r=arguments[t],e=r.length;--t>=0;)r=n(arguments[t],r);return rn(e,r)}},ar=function(n,t){return h(function(r){for(var e,u=-1,i=t;++u<r.length;)e=+r[u],n(e,i)&&(i=e);return i})},sr=function(n){return function(t){var r=T(arguments,1);return rn(Math.max(0,t.length-r.length),function(){return t.apply(this,n(r,arguments))})}},lr=function(n,t,r){return function(){var e=arguments.length;if(0===e)return r();var u=arguments[e-1];if(!_(u)){var i=T(arguments,0,e-1);if("function"==typeof u[n])return u[n].apply(u,i);if(k(u)){var o=t.apply(null,i);return o(u)}}return r.apply(this,arguments)}},hr=function yu(n,t){switch(n.length){case 0:return t;case 1:return y(n[0],t);default:var r=n[0],e=T(n,1);return null==t[r]?t:u(r,yu(e,t[r]),t)}},pr=function(n,t){return null!=t&&!_(t)&&"function"==typeof t[n]},gr=function(n){return function t(r){for(var e,u,i,o=[],f=-1,c=r.length;++f<c;)if(Ln(r[f]))for(e=n?t(r[f]):r[f],u=-1,i=e.length;++u<i;)o[o.length]=e[u];else o[o.length]=r[f];return o}},yr=function(n,t){return C(wt(n),t)},mr=function(){function n(n,t,r){for(var e=-1,u=r.length;++e<u;)if(t=n.step(t,r[e]),t&&t.__transducers_reduced__){t=t.value;break}return n.result(t)}function t(n,t,r){for(var e=r.next();!e.done;){if(t=n.step(t,e.value),t&&t.__transducers_reduced__){t=t.value;break}e=r.next()}return n.result(t)}function r(n,t,r){return n.result(r.reduce(un(n.step,n),t))}var e="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";return function(u,i,o){if("function"==typeof u&&(u=Q(u)),Ln(o))return n(u,i,o);if("function"==typeof o.reduce)return r(u,i,o);if(null!=o[e])return t(u,i,o[e]());if("function"==typeof o.next)return t(u,i,o);throw new TypeError("reduce: list must be array or iterable")}}(),vr=function(){function n(n,t){this.xf=t,this.f=n,this.inputs={}}return n.prototype.init=function(){return this.xf.init()},n.prototype.result=function(n){var t;for(t in this.inputs)if(b(t,this.inputs)&&(n=this.xf.step(n,this.inputs[t]),n.__transducers_reduced__)){n=n.value;break}return this.xf.result(n)},n.prototype.step=function(n,t){var r=this.f(t);return this.inputs[r]=this.inputs[r]||[r,[]],this.inputs[r][1]=rr(t,this.inputs[r][1]),n},p(function(t,r){return new n(t,r)})}(),dr=p(lr("all",q,r)),xr=p(lr("any",B,e)),wr=p(rr),br=g(er),jr=h(function(n){return et(2,n)}),Or=h(function(n){return ur(n,[],[])}),_r=cr(f),Ir=cr(or),Ar=p(function(n,t){if(_(t))return c(n,t);if(pr("concat",n))return n.concat(t);throw new TypeError("can't concat "+typeof n)}),kr=p(fr),Er=pn(3,function(n){var t=T(arguments,1);return function(){var r=arguments;return n.apply(this,C(function(n){return n.apply(this,r)},t))}}),Pr=h(function(n){return pn(n.length,n)}),Cr=p(function(n,t){for(var r=[],e=-1,u=n.length;++e<u;)fr(n[e],t)||fr(n[e],r)||(r[r.length]=n[e]);return r}),Mr=p(hr),Sr=p(lr("drop",z,function(n,t){return n<t.length?T(t,n):[]})),Wr=p(lr("dropWhile",D,function(n,t){for(var r=-1,e=t.length;++r<e&&n(t[r]););return T(t,r)})),Nr=h(function(n){return pr("empty",n)?n.empty():[]}),Rr=p(lr("filter",F,m)),Lr=p(lr("find",U,function(n,t){for(var r=-1,e=t.length;++r<e;)if(n(t[r]))return t[r]})),Tr=p(lr("findIndex",X,function(n,t){for(var r=-1,e=t.length;++r<e;)if(n(t[r]))return r;return-1})),qr=p(lr("findLast",$,function(n,t){for(var r=t.length;--r>=0;)if(n(t[r]))return t[r]})),Br=p(lr("findLastIndex",G,function(n,t){for(var r=t.length;--r>=0;)if(n(t[r]))return r;return-1})),zr=h(gr(!0)),Dr=h(function(n){return Pr(function(t,r){var e=T(arguments);return e[0]=r,e[1]=t,n.apply(this,e)})}),Fr=Pr(function(n,t){return t[n].apply(t,T(arguments,2))}),Ur=h(x(Dn)),Xr=p(lr("groupBy",vr,function(n,t){return mr(function(t,r){var e=n(r);return t[e]=rr(r,t[e]||(t[e]=[])),t},{},t)})),$r=ot(0),Gr=g(function(n,t,r){return n=n<r.length&&n>=0?n:r.length,c(rr(t,T(r,0,n)),T(r,n))}),Hr=g(function(n,t,r){for(var e=[],u=-1;++u<t.length;)a(n,t[u],r)&&(e[e.length]=t[u]);return Ht(n,e)}),Jr=Pr(function(n,t,r){return r[n].apply(r,t)}),Kr=Pr(function(n,t){var r=T(arguments,2),e=n-r.length;return pn(e+1,function(){var n=arguments[e],u=r.concat(T(arguments,0,e));return n[t].apply(n,u)})}),Qr=Kr(1,"join"),Vr=function(){var n=!{toString:null}.propertyIsEnumerable("toString"),t=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];return h(function(r){if(Object(r)!==r)return[];if(Object.keys)return Object.keys(r);var e,u,i=[];for(e in r)b(e,r)&&(i[i.length]=e);if(n)for(u=t.length;--u>=0;)e=t[u],b(e,r)&&!fr(e,i)&&(i[i.length]=e);return i})}(),Yr=ot(-1),Zr=p(lr("map",H,C)),ne=p(function(n,t){return mr(function(r,e){return r[e]=n(t[e]),r},{},Vr(t))}),te=p(function(n,t){return mr(function(r,e){return r[e]=n(t[e],e,t),r},{},Vr(t))}),re=Kr(1,"match"),ee=ar(w,-(1/0)),ue=ar(P,1/0),ie=p(o(lr("any",B,e))),oe=Pr(sr(c)),fe=Pr(sr(Dr(c))),ce=p(function(n,t){return mr(function(t,r){var e=t[n(r)?0:1];return e[e.length]=r,t},[[],[]],t)}),ae=function(){return _r.apply(this,Mt(arguments))},se=function(){return Ir.apply(this,Mt(arguments))},le=p(yr),he=g(mr),pe=p(function(n,t){return Rr(o(n),t)}),ge=p(function(n,t){return Bt(Y(n),t)}),ye=g(ir("slice",function(n,t,r){return Array.prototype.slice.call(r,n,t)})),me=p(function(n,t){return Or(t).sort(n)}),ve=Kr(1,"split"),de=ye,xe=de(n,1/0),we=de(0),be=he(t,0),je=ir("tail",function(n){return T(n,1)}),Oe=p(lr("take",J,function(n,t){return T(t,0,Math.min(n,t.length))})),_e=p(lr("takeWhile",K,function(n,t){for(var r=-1,e=t.length;++r<e&&n(t[r]););return T(t,0,r)})),Ie=Kr(0,"toLowerCase"),Ae=Kr(0,"toUpperCase"),ke=pn(4,function(n,t,r,e){return mr(n("function"==typeof t?Q(t):t),r,e)}),Ee=g(function(n,t,r){return Ht(n,c(t,r))}),Pe=h(function(n){for(var t,r=-1,e=n.length,u=[];++r<e;)t=n[r],fr(t,u)||(u[u.length]=t);return u}),Ce=h(gr(!1)),Me=Pr(function(n){var t=T(arguments,1),r=t.length;return Pr(rn(r,function(){for(var e=[],u=-1;++u<r;)e[u]=t[u](arguments[u]);return n.apply(this,e.concat(T(arguments,r)))}))}),Se=h(function(n){for(var t=Vr(n),r=t.length,e=[],u=-1;++u<r;)e[u]=n[t[u]];return e}),We=p(function(n,t){var r=Xr(function(t){return"function"==typeof n[t]?"fn":"obj"},Vr(n));return L(n,r,t)}),Ne=function mu(n,t,r,e){var u=Ut(n);if(u!==Ut(t))return!1;if(wn(n,t))return!0;if("RegExp"==u)return n.source===t.source&&n.global===t.global&&n.ignoreCase===t.ignoreCase&&n.multiline===t.multiline&&n.sticky===t.sticky&&n.unicode===t.unicode;if(Object(n)===n){if("Date"===u&&n.getTime()!=t.getTime())return!1;var i=Vr(n);if(i.length!==Vr(t).length)return!1;for(var o=r.length;--o>=0;)if(r[o]===n)return e[o]===t;for(r[r.length]=n,e[e.length]=t,o=i.length;--o>=0;){var f=i[o];if(!b(f,t)||!mu(t[f],n[f],r,e))return!1}return r.pop(),e.pop(),!0}return!1},Re=function(n,t){for(var r=Vr(t),e=-1,u=r.length;++e<u;)n[r[e]]=t[r[e]];return n},Le=function(n){return function(t){var r=function(){var r=arguments;return n(function(n){return n.apply(null,r)},t)};return arguments.length>1?r.apply(null,T(arguments,1)):rn(ee(yr("length",t)),r)}},Te=Pr(Le(r)),qe=Pr(Le(e)),Be=p(function(n,t){return pr("ap",n)?n.ap(t):mr(function(n,r){return c(n,Zr(r,t))},[],n)}),ze=Pr(function(n){return n.apply(this,T(arguments,1))}),De=p(ir("chain",function(n,t){return Ce(C(n,t))})),Fe=Kr(1,"charAt"),Ue=Kr(1,"charCodeAt"),Xe=g(function(n,t,r){function e(t,r){return Be(Zr(wr,n(r)),t)}return mr(e,t([]),r)}),$e=p(function(n,t){if(n>10)throw new Error("Constructor with greater than ten arguments");return 0===n?function(){return new t}:Pr(et(n,function(n,r,e,u,i,o,f,c,a,s){switch(arguments.length){case 1:return new t(n);case 2:return new t(n,r);case 3:return new t(n,r,e);case 4:return new t(n,r,e,u);case 5:return new t(n,r,e,u,i);case 6:return new t(n,r,e,u,i,o);case 7:return new t(n,r,e,u,i,o,f);case 8:return new t(n,r,e,u,i,o,f,c);case 9:return new t(n,r,e,u,i,o,f,c,a);case 10:return new t(n,r,e,u,i,o,f,c,a,s)}}))}),Ge=p(function(n,t){return Ne(n,t,[],[])}),He=p(function(n,t){return Re(Re({},t),te(function(n,r){return n(t[r])},n))}),Je=h(x(Vr)),Ke=ye(0,-1),Qe=p(function(n,t){return Pe(m(Dr(fr)(n),t))}),Ve=h(function(n){for(var t=Vr(n),r=t.length,e=-1,u={};++e<r;){var i=t[e],o=n[i],f=b(o,u)?u[o]:u[o]=[];f[f.length]=i}return u}),Ye=h(function(n){for(var t=Vr(n),r=t.length,e=-1,u={};++e<r;){var i=t[e];u[n[i]]=i}return u}),Ze=p(function(n,t){var r=pn(n,t);return pn(n,function(){return mr(Be,Zr(r,arguments[0]),T(arguments,1))})}),nu=p(function(n,t){return Re(Re({},n),t)}),tu=h(function(n){return he(nu,{},n)}),ru=he(M,1),eu=Me(C,vt,Cn),uu=p(_r(Pe,c)),iu=function(){var n={init:Array,step:function(n,t){return c(n,[t])},result:j},r={init:String,step:t,result:j},e={init:Object,step:function(n,t){return nu(n,Ln(t)?s(t[0],t[1]):t)},result:j};return function(t){if(k(t))return t;if(Ln(t))return n;if("string"==typeof t)return r;if("object"==typeof t)return e;throw new Error("Cannot create transformer for "+t)}}(),ou=Xe(Zr(Cn)),fu=h(function(n){return $e(n.length,n)}),cu=g(function(n,t,r){return k(n)?mr(t(n),n.init(),r):mr(t(iu(n)),n,r)}),au=h(function(n){return Ze(n.length,n)}),su={F:nr,T:tr,__:n,add:V,all:dr,allPass:Te,always:Y,and:Z,any:xr,anyPass:qe,ap:Be,aperture:nn,append:wr,apply:tn,arity:rn,assoc:en,assocPath:br,binary:jr,bind:un,both:on,call:ze,chain:De,charAt:Fe,charCodeAt:Ue,clone:Or,commute:ou,commuteMap:Xe,comparator:fn,complement:cn,compose:_r,composeP:Ir,concat:Ar,cond:an,construct:fu,constructN:$e,contains:kr,containsWith:sn,converge:Er,countBy:ln,createMapEntry:hn,curry:Pr,curryN:pn,dec:gn,defaultTo:yn,difference:Cr,differenceWith:mn,dissoc:vn,dissocPath:Mr,divide:dn,drop:Sr,dropWhile:Wr,either:xn,empty:Nr,eq:wn,eqDeep:Ge,eqProps:bn,evolve:He,filter:Rr,filterIndexed:jn,find:Lr,findIndex:Tr,findLast:qr,findLastIndex:Br,flatten:zr,flip:Dr,forEach:On,forEachIndexed:_n,fromPairs:In,func:Fr,functions:Je,functionsIn:Ur,groupBy:Xr,gt:An,gte:kn,has:En,hasIn:Pn,head:$r,identity:Cn,ifElse:Mn,inc:Sn,indexOf:Wn,init:Ke,insert:Gr,insertAll:Nn,intersection:Qe,intersectionWith:Hr,into:cu,invert:Ve,invertObj:Ye,invoke:Jr,invoker:Kr,is:Rn,isArrayLike:Ln,isEmpty:Tn,isNaN:qn,isNil:Bn,isSet:zn,join:Qr,keys:Vr,keysIn:Dn,last:Yr,lastIndexOf:Fn,length:Un,lens:Xn,lensOn:$n,lift:au,liftN:Ze,lt:Gn,lte:Hn,map:Zr,mapAccum:Jn,mapAccumRight:Kn,mapIndexed:Qn,mapObj:ne,mapObjIndexed:te,match:re,mathMod:Vn,max:ee,maxBy:Yn,memoize:Zn,merge:nu,mergeAll:tu,min:ue,minBy:nt,modulo:tt,multiply:rt,nAry:et,negate:ut,none:ie,not:it,nth:ot,nthArg:ft,nthChar:ct,nthCharCode:at,of:st,omit:lt,once:ht,or:pt,partial:oe,partialRight:fe,partition:ce,path:gt,pathEq:yt,pick:mt,pickAll:vt,pickBy:dt,pipe:ae,pipeP:se,pluck:le,prepend:xt,product:ru,project:eu,prop:wt,propEq:bt,propOr:jt,props:Ot,range:_t,reduce:he,reduceIndexed:It,reduceRight:At,reduceRightIndexed:kt,reject:pe,rejectIndexed:Et,remove:Pt,repeat:ge,replace:Ct,reverse:Mt,scan:St,slice:ye,sort:me,sortBy:Wt,split:ve,strIndexOf:Nt,strLastIndexOf:Rt,substring:de,substringFrom:xe,substringTo:we,subtract:Lt,sum:be,tail:je,take:Oe,takeWhile:_e,tap:Tt,test:qt,times:Bt,toLower:Ie,toPairs:zt,toPairsIn:Dt,toUpper:Ae,transduce:ke,trim:Ft,type:Ut,unapply:Xt,unary:$t,unfold:Gt,union:uu,unionWith:Ee,uniq:Pe,uniqWith:Ht,unnest:Ce,useWith:Me,values:Se,valuesIn:Jt,where:We,wrap:Kt,xprod:Qt,zip:Vt,zipObj:Yt,zipWith:Zt};"object"==typeof exports?module.exports=su:"function"==typeof define&&define.amd?define(function(){return su}):this.R=su}).call(this); | ||
(function(){"use strict";var n={ramda:"placeholder"},t=function(n,t){return n+t},r=function(n,t){for(var r=-1;++r<t.length;)if(!n(t[r]))return!1;return!0},e=function(n,t){for(var r=-1;++r<t.length;)if(n(t[r]))return!0;return!1},u=function(n,t,r){var e={};for(var u in r)e[u]=r[u];return e[n]=t,e},i=function(n){return new RegExp(n.source,(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":""))},o=function(n){return function(){return!n.apply(this,arguments)}},c=function(n,t){return function(){return n.call(this,t.apply(this,arguments))}},f=function(n,t){n=n||[],t=t||[];var r,e=n.length,u=t.length,i=[];for(r=-1;++r<e;)i[i.length]=n[r];for(r=-1;++r<u;)i[i.length]=t[r];return i},a=function(n,t,r){for(var e=-1,u=r.length;++e<u;)if(n(t,r[e]))return!0;return!1},s=function(n,t){var r={};return r[n]=t,r},l=function(n){return function(t,r){if(r&&r.length>0){for(var e,u=0,i=r[u],o=t(i);++u<r.length;)e=t(r[u]),n(e,o)&&(o=e,i=r[u]);return i}}},p=function(t){return function r(e){return 0===arguments.length?r:e===n?r:t(e)}},h=function(t){return function r(e,u){var i=arguments.length;return 0===i?r:1===i&&e===n?r:1===i?p(function(n){return t(e,n)}):2===i&&e===n&&u===n?r:2===i&&e===n?p(function(n){return t(n,u)}):2===i&&u===n?p(function(n){return t(e,n)}):t(e,u)}},g=function(t){return function r(e,u,i){var o=arguments.length;return 0===o?r:1===o&&e===n?r:1===o?h(function(n,r){return t(e,n,r)}):2===o&&e===n&&u===n?r:2===o&&e===n?h(function(n,r){return t(n,u,r)}):2===o&&u===n?h(function(n,r){return t(e,n,r)}):2===o?p(function(n){return t(e,u,n)}):3===o&&e===n&&u===n&&i===n?r:3===o&&e===n&&u===n?h(function(n,r){return t(n,r,i)}):3===o&&e===n&&i===n?h(function(n,r){return t(n,u,r)}):3===o&&u===n&&i===n?h(function(n,r){return t(e,n,r)}):3===o&&e===n?p(function(n){return t(n,u,i)}):3===o&&u===n?p(function(n){return t(e,n,i)}):3===o&&i===n?p(function(n){return t(e,u,n)}):t(e,u,i)}},d=function(n,t){var r={};for(var e in t)e!==n&&(r[e]=t[e]);return r},y=function(n,t){return 0===n?1/n===1/t:n===t||n!==n&&t!==t},m=function(n,t){for(var r=-1,e=t.length,u=[];++r<e;)n(t[r])&&(u[u.length]=t[r]);return u},v=function(n,t){for(var r=-1,e=t.length,u=[];++r<e;)n(t[r],r,t)&&(u[u.length]=t[r]);return u},x=function(n,t){for(var r=-1,e=t.length;++r<e;)n(t[r]);return t},w=function(n){return function(t){return m(function(n){return"function"==typeof t[n]},n(t))}},b=function(n,t){return n>t},j=function(n,t){return Object.prototype.hasOwnProperty.call(t,n)},O=function(n){return n},I=function(n,t,r){var e=0,u=n.length;for("number"==typeof r&&(e=0>r?Math.max(0,u+r):r);u>e;){if(y(n[e],t))return e;++e}return-1},S=Array.isArray||function(n){return null!=n&&n.length>=0&&"[object Array]"===Object.prototype.toString.call(n)},E=Number.isInteger||function(n){return n<<0===n},N=function(n){return null!=n&&n===Object(n)&&"function"==typeof n.then},k=function(n){return"function"==typeof n["@@transducer/step"]},A=function(n,t,r){var e=n.length;for("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1));--e>=0;)if(y(n[e],t))return e;return-1},C=function(n,t){return t>n},M=function(n,t){for(var r=-1,e=t.length,u=[];++r<e;)u[r]=n(t[r]);return u},P=function(n,t){return n*t},T=function(n,t){return 0>n?t[t.length+n]:t[n]},R=function(n,t){if(null!=t){for(var r=t,e=0,u=n.length;u>e&&null!=r;e+=1)r=r[n[e]];return r}},W=function(n,t){return f([n],t)},L=function(n){return'"'+n.replace(/"/g,'\\"')+'"'},U=function(n){return n&&n["@@transducer/reduced"]?n:{"@@transducer/value":n,"@@transducer/reduced":!0}},B=function ku(n,t,r){switch(arguments.length){case 1:return ku(n,0,n.length);case 2:return ku(n,t,n.length);default:for(var e=[],u=-1,i=Math.max(0,Math.min(n.length,r)-t);++u<i;)e[u]=n[t+u];return e}},F=function(){var n=function(n){return(10>n?"0":"")+n};return"function"==typeof Date.prototype.toISOString?function(n){return n.toISOString()}:function(t){return t.getUTCFullYear()+"-"+n(t.getUTCMonth()+1)+"-"+n(t.getUTCDate())+"T"+n(t.getUTCHours())+":"+n(t.getUTCMinutes())+":"+n(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}}(),q=function(){function n(n,t){this.xf=t,this.pred=n,this.lastValue=void 0,this.seenFirstValue=!1}return n.prototype["@@transducer/init"]=function(){return this.xf["@@transducer/init"]()},n.prototype["@@transducer/result"]=function(n){return this.xf["@@transducer/result"](n)},n.prototype["@@transducer/step"]=function(n,t){var r=!1;return this.seenFirstValue?this.pred(this.lastValue,t)&&(r=!0):this.seenFirstValue=!0,this.lastValue=t,r?n:this.xf["@@transducer/step"](n,t)},h(function(t,r){return new n(t,r)})}(),D={init:function(){return this.xf["@@transducer/init"]()},result:function(n){return this.xf["@@transducer/result"](n)}},V=function(){function n(n,t){this.xf=t,this.f=n}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=D.result,n.prototype["@@transducer/step"]=function(n,t){return this.f(t)?this.xf["@@transducer/step"](n,t):n},h(function(t,r){return new n(t,r)})}(),z=function(){function n(n,t){this.xf=t,this.f=n,this.found=!1}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=function(n){return this.found||(n=this.xf["@@transducer/step"](n,void 0)),this.xf["@@transducer/result"](n)},n.prototype["@@transducer/step"]=function(n,t){return this.f(t)&&(this.found=!0,n=U(this.xf["@@transducer/step"](n,t))),n},h(function(t,r){return new n(t,r)})}(),_=function(){function n(n,t){this.xf=t,this.f=n,this.idx=-1,this.found=!1}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=function(n){return this.found||(n=this.xf["@@transducer/step"](n,-1)),this.xf["@@transducer/result"](n)},n.prototype["@@transducer/step"]=function(n,t){return this.idx+=1,this.f(t)&&(this.found=!0,n=U(this.xf["@@transducer/step"](n,this.idx))),n},h(function(t,r){return new n(t,r)})}(),H=function(){function n(n,t){this.xf=t,this.f=n}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=function(n){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](n,this.last))},n.prototype["@@transducer/step"]=function(n,t){return this.f(t)&&(this.last=t),n},h(function(t,r){return new n(t,r)})}(),X=function(){function n(n,t){this.xf=t,this.f=n,this.idx=-1,this.lastIdx=-1}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=function(n){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](n,this.lastIdx))},n.prototype["@@transducer/step"]=function(n,t){return this.idx+=1,this.f(t)&&(this.lastIdx=this.idx),n},h(function(t,r){return new n(t,r)})}(),Y=function(){function n(n,t){this.xf=t,this.f=n}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=D.result,n.prototype["@@transducer/step"]=function(n,t){return this.xf["@@transducer/step"](n,this.f(t))},h(function(t,r){return new n(t,r)})}(),Z=function(){function n(n,t){this.xf=t,this.n=n}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=D.result,n.prototype["@@transducer/step"]=function(n,t){return this.n-=1,0===this.n?U(this.xf["@@transducer/step"](n,t)):this.xf["@@transducer/step"](n,t)},h(function(t,r){return new n(t,r)})}(),$=function(){function n(n,t){this.xf=t,this.f=n}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=D.result,n.prototype["@@transducer/step"]=function(n,t){return this.f(t)?this.xf["@@transducer/step"](n,t):U(n)},h(function(t,r){return new n(t,r)})}(),G=function(){function n(n){this.f=n}return n.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},n.prototype["@@transducer/result"]=function(n){return n},n.prototype["@@transducer/step"]=function(n,t){return this.f(n,t)},function(t){return new n(t)}}(),J=h(t),K=g(function(n,t,r){if(t>=r.length||t<-r.length)return r;var e=0>t?r.length:0,u=e+t,i=f(r);return i[u]=n(r[u]),i}),Q=p(function(n){return function(){return n}}),nn=h(function(n,t){for(var r=-1,e=t.length-(n-1),u=new Array(e>=0?e:0);++r<e;)u[r]=B(t,r,r+n);return u}),tn=h(function(n,t){return n.apply(this,t)}),rn=h(function(n,t){switch(n){case 0:return function(){return t.apply(this,arguments)};case 1:return function(n){return t.apply(this,arguments)};case 2:return function(n,r){return t.apply(this,arguments)};case 3:return function(n,r,e){return t.apply(this,arguments)};case 4:return function(n,r,e,u){return t.apply(this,arguments)};case 5:return function(n,r,e,u,i){return t.apply(this,arguments)};case 6:return function(n,r,e,u,i,o){return t.apply(this,arguments)};case 7:return function(n,r,e,u,i,o,c){return t.apply(this,arguments)};case 8:return function(n,r,e,u,i,o,c,f){return t.apply(this,arguments)};case 9:return function(n,r,e,u,i,o,c,f,a){return t.apply(this,arguments)};case 10:return function(n,r,e,u,i,o,c,f,a,s){return t.apply(this,arguments)};default:throw new Error("First argument to arity must be a non-negative integer no greater than ten")}}),en=g(u),un=h(function(n,t){return rn(n.length,function(){return n.apply(t,arguments)})}),on=h(function(n,t){return function(){return n.apply(this,arguments)&&t.apply(this,arguments)}}),cn=p(function(n){return function(t,r){return n(t,r)?-1:n(r,t)?1:0}}),fn=p(o),an=function(){var n=arguments;return function(){for(var t=-1;++t<n.length;)if(n[t][0].apply(this,arguments))return n[t][1].apply(this,arguments)}},sn=g(a),ln=h(function(n,t){for(var r={},e=t.length,u=-1;++u<e;){var i=n(t[u]);r[i]=(j(i,r)?r[i]:0)+1}return r}),pn=h(s),hn=h(function Au(t,r){return rn(t,function(){for(var e=arguments.length,u=t-e,i=e;--i>=0;)arguments[i]===n&&(u+=1);if(0>=u)return r.apply(this,arguments);var o=B(arguments);return Au(u,function(){for(var t=B(arguments),u=[],i=-1;++i<e;){var c=o[i];u[i]=c===n?t.shift():c}return r.apply(this,u.concat(t))})})}),gn=J(-1),dn=h(function(n,t){return null==t?n:t}),yn=g(function(n,t,r){for(var e=[],u=-1,i=t.length,o=sn(n);++u<i;)o(t[u],r)||o(t[u],e)||(e[e.length]=t[u]);return e}),mn=h(d),vn=h(function(n,t){return n/t}),xn=h(function(n,t){return function(){return n.apply(this,arguments)||t.apply(this,arguments)}}),wn=h(y),bn=g(function(n,t,r){return y(t[n],r[n])}),jn=h(v),On=h(x),In=h(function(n,t){for(var r=-1,e=t.length;++r<e;)n(t[r],r,t);return t}),Sn=p(function(n){for(var t=-1,r=n.length,e={};++t<r;)S(n[t])&&n[t].length&&(e[n[t][0]]=n[t][1]);return e}),En=h(b),Nn=h(function(n,t){return n>=t}),kn=h(j),An=h(function(n,t){return n in t}),Cn=p(O),Mn=g(function(n,t,r){return hn(Math.max(n.length,t.length,r.length),function(){return n.apply(this,arguments)?t.apply(this,arguments):r.apply(this,arguments)})}),Pn=J(1),Tn=h(function(n,t){return I(t,n)}),Rn=g(function(n,t,r){return n=n<r.length&&n>=0?n:r.length,f(f(B(r,0,n),t),B(r,n))}),Wn=h(function(n,t){return null!=t&&t.constructor===n||t instanceof n}),Ln=p(function(n){return S(n)?!0:n?"object"!=typeof n?!1:n instanceof String?!1:1===n.nodeType?!!n.length:0===n.length?!0:n.length>0?n.hasOwnProperty(0)&&n.hasOwnProperty(n.length-1):!1:!1}),Un=p(function(n){return 0===Object(n).length}),Bn=p(function(n){return"number"==typeof n&&n!==n}),Fn=p(function(n){return null==n}),qn=p(function(n){for(var t=n.length,r=-1;++r<t;)if(I(n,n[r],r+1)>=0)return!1;return!0}),Dn=p(function(n){var t,r=[];for(t in n)r[r.length]=t;return r}),Vn=h(function(n,t){return A(t,n)}),zn=p(function(n){return null!=n&&Wn(Number,n.length)?n.length:NaN}),_n=h(function(n,t){var r=function(t){return n(t)};return r.set=h(t),r.map=h(function(r,e){return t(r(n(e)),e)}),r}),Hn=g(function(n,t,r){var e=function(){return n(r)};return e.set=t,e.map=function(e){return t(e(n(r)))},e}),Xn=h(C),Yn=h(function(n,t){return t>=n}),Zn=g(function(n,t,r){for(var e=-1,u=r.length,i=[],o=[t];++e<u;)o=n(o[0],r[e]),i[e]=o[1];return[o[0],i]}),$n=g(function(n,t,r){for(var e=r.length,u=[],i=[t];--e>=0;)i=n(i[0],r[e]),u[e]=i[1];return[i[0],u]}),Gn=h(function(n,t){for(var r=-1,e=t.length,u=[];++r<e;)u[r]=n(t[r],r,t);return u}),Jn=h(function(n,t){return E(n)?!E(t)||1>t?NaN:(n%t+t)%t:NaN}),Kn=h(l(b)),Qn=h(l(C)),nt=h(function(n,t){return n%t}),tt=h(P),rt=h(function(n,t){switch(n){case 0:return function(){return t.call(this)};case 1:return function(n){return t.call(this,n)};case 2:return function(n,r){return t.call(this,n,r)};case 3:return function(n,r,e){return t.call(this,n,r,e)};case 4:return function(n,r,e,u){return t.call(this,n,r,e,u)};case 5:return function(n,r,e,u,i){return t.call(this,n,r,e,u,i)};case 6:return function(n,r,e,u,i,o){return t.call(this,n,r,e,u,i,o)};case 7:return function(n,r,e,u,i,o,c){return t.call(this,n,r,e,u,i,o,c)};case 8:return function(n,r,e,u,i,o,c,f){return t.call(this,n,r,e,u,i,o,c,f)};case 9:return function(n,r,e,u,i,o,c,f,a){return t.call(this,n,r,e,u,i,o,c,f,a)};case 10:return function(n,r,e,u,i,o,c,f,a,s){return t.call(this,n,r,e,u,i,o,c,f,a,s)};default:throw new Error("First argument to nAry must be a non-negative integer no greater than ten")}}),et=p(function(n){return-n}),ut=p(function(n){return!n}),it=h(T),ot=p(function(n){return function(){return T(n,arguments)}}),ct=h(function(n,t){return t.charAt(0>n?t.length+n:n)}),ft=h(function(n,t){return t.charCodeAt(0>n?t.length+n:n)}),at=p(function(n){return[n]}),st=h(function(n,t){var r={};for(var e in t)I(n,e)<0&&(r[e]=t[e]);return r}),lt=p(function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments))}}),pt=h(R),ht=g(function(n,t,r){return y(R(n,r),t)}),gt=h(function(n,t){var r={};for(var e in t)I(n,e)>=0&&(r[e]=t[e]);return r}),dt=h(function(n,t){for(var r={},e=-1,u=n.length;++e<u;){var i=n[e];r[i]=t[i]}return r}),yt=h(function(n,t){var r={};for(var e in t)n(t[e],e,t)&&(r[e]=t[e]);return r}),mt=h(W),vt=h(function(n,t){return t[n]}),xt=g(function(n,t,r){return y(r[n],t)}),wt=g(function(n,t,r){return j(t,r)?r[t]:n}),bt=h(function(n,t){for(var r=n.length,e=[],u=-1;++u<r;)e[u]=t[n[u]];return e}),jt=h(function(n,t){for(var r=[],e=n;t>e;)r[r.length]=e,e+=1;return r}),Ot=g(function(n,t,r){for(var e=-1,u=r.length;++e<u;)t=n(t,r[e],e,r);return t}),It=g(function(n,t,r){for(var e=r.length;--e>=0;)t=n(t,r[e]);return t}),St=g(function(n,t,r){for(var e=r.length;--e>=0;)t=n(t,r[e],e,r);return t}),Et=h(function(n,t){return v(o(n),t)}),Nt=g(function(n,t,r){return f(B(r,0,Math.min(n,r.length)),B(r,Math.min(r.length,n+t)))}),kt=g(function(n,t,r){return r.replace(n,t)}),At=p(function(n){return B(n).reverse()}),Ct=g(function(n,t,r){for(var e=0,u=r.length+1,i=[t];++e<u;)t=n(t,r[e-1]),i[e]=t;return i}),Mt=h(function(n,t){return B(t).sort(n)}),Pt=h(function(n,t){return B(t).sort(function(t,r){var e=n(t),u=n(r);return u>e?-1:e>u?1:0})}),Tt=h(function(n,t){return t.indexOf(n)}),Rt=h(function(n,t){return t.lastIndexOf(n)}),Wt=h(function(n,t){return n-t}),Lt=h(function(n,t){return n(t),t}),Ut=h(function(n,t){return i(n).test(t)}),Bt=h(function(n,t){for(var r=Number(t),e=new Array(r),u=0;r>u;)e[u]=n(u),u+=1;return e}),Ft=p(function(n){var t=[];for(var r in n)j(r,n)&&(t[t.length]=[r,n[r]]);return t}),qt=p(function(n){var t=[];for(var r in n)t[t.length]=[r,n[r]];return t}),Dt=function(){var n=" \n\f\r \u2028\u2029\ufeff",t="",r="function"==typeof String.prototype.trim;return p(r&&!n.trim()&&t.trim()?function(n){return n.trim()}:function(t){var r=new RegExp("^["+n+"]["+n+"]*"),e=new RegExp("["+n+"]["+n+"]*$");return t.replace(r,"").replace(e,"")})}(),Vt=p(function(n){return null===n?"Null":void 0===n?"Undefined":Object.prototype.toString.call(n).slice(8,-1)}),zt=p(function(n){return function(){return n(B(arguments))}}),_t=p(function(n){return rt(1,n)}),Ht=h(function(n,t){return hn(n,function(){for(var r,e=1,u=t,i=0;n>=e&&"function"==typeof u;)r=e===n?arguments.length:i+u.length,u=u.apply(this,B(arguments,i,r)),e+=1,i=r;return u})}),Xt=h(function(n,t){for(var r=n(t),e=[];r&&r.length;)e[e.length]=r[0],r=n(r[1]);return e}),Yt=h(function(n,t){for(var r,e=-1,u=t.length,i=[];++e<u;)r=t[e],a(n,r,i)||(i[i.length]=r);return i}),Zt=g(function(n,t,r){return K(Q(t),n,r)}),$t=p(function(n){var t,r=[];for(t in n)r[r.length]=n[t];return r}),Gt=h(function(n,t){for(var r in n)if(j(r,n)&&!n[r](t[r]))return!1;return!0}),Jt=h(function(n,t){return hn(n.length,function(){return t.apply(this,f([n],arguments))})}),Kt=h(function(n,t){for(var r,e=-1,u=n.length,i=t.length,o=[];++e<u;)for(r=-1;++r<i;)o[o.length]=[n[e],t[r]];return o}),Qt=h(function(n,t){for(var r=[],e=-1,u=Math.min(n.length,t.length);++e<u;)r[e]=[n[e],t[e]];return r}),nr=h(function(n,t){for(var r=-1,e=n.length,u={};++r<e;)u[n[r]]=t[r];return u}),tr=g(function(n,t,r){for(var e=[],u=-1,i=Math.min(t.length,r.length);++u<i;)e[u]=n(t[u],r[u]);return e}),rr=Q(!1),er=Q(!0),ur=function(n,t){return f(t,[n])},ir=function Cu(n,t,r){switch(n.length){case 0:return r;case 1:return u(n[0],t,r);default:return u(n[0],Cu(B(n,1),t,Object(r[n[0]])),r)}},or=function Mu(n,t,r){var e=function(e){for(var u=t.length,i=-1;++i<u;)if(n===t[i])return r[i];t[i+1]=n,r[i+1]=e;for(var o in n)e[o]=Mu(n[o],t,r);return e};switch(Vt(n)){case"Object":return e({});case"Array":return e([]);case"Date":return new Date(n);case"RegExp":return i(n);default:return n}},cr=function(n,t){return function(){var r=arguments.length;if(0===r)return t();var e=arguments[r-1];return S(e)||"function"!=typeof e[n]?t.apply(this,arguments):e[n].apply(e,B(arguments,0,r-1))}},fr=function(n,t){return _n(c(n,t),function(r,e){var u=n.set(r,t(e));return t.set(u,e)})},ar=function(n,t){return function(){var r=this,e=t.apply(this,arguments);return N(e)?e.then(function(t){return n.call(r,t)}):n.call(this,e)}},sr=function(n,t){return I(t,n)>=0},lr=function(n){return function(){for(var t=arguments.length-1,r=arguments[t],e=r.length;--t>=0;)r=n(arguments[t],r);return rn(e,r)}},pr=function(n,t){return p(function(r){for(var e,u=-1,i=t;++u<r.length;)e=+r[u],n(e,i)&&(i=e);return i})},hr=function(n){return function(t){var r=B(arguments,1);return rn(Math.max(0,t.length-r.length),function(){return t.apply(this,n(r,arguments))})}},gr=function(n,t,r){return function(){var e=arguments.length;if(0===e)return r();var u=arguments[e-1];if(!S(u)){var i=B(arguments,0,e-1);if("function"==typeof u[n])return u[n].apply(u,i);if(k(u)){var o=t.apply(null,i);return o(u)}}return r.apply(this,arguments)}},dr=function Pu(n,t){switch(n.length){case 0:return t;case 1:return d(n[0],t);default:var r=n[0],e=B(n,1);return null==t[r]?t:u(r,Pu(e,t[r]),t)}},yr=function(n,t){return null!=t&&!S(t)&&"function"==typeof t[n]},mr=function(n){return function t(r){for(var e,u,i,o=[],c=-1,f=r.length;++c<f;)if(Ln(r[c]))for(e=n?t(r[c]):r[c],u=-1,i=e.length;++u<i;)o[o.length]=e[u];else o[o.length]=r[c];return o}},vr=function(){function n(n,t,r){for(var e=-1,u=r.length;++e<u;)if(t=n["@@transducer/step"](t,r[e]),t&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}return n["@@transducer/result"](t)}function t(n,t,r){for(var e=r.next();!e.done;){if(t=n["@@transducer/step"](t,e.value),t&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}e=r.next()}return n["@@transducer/result"](t)}function r(n,t,r){return n["@@transducer/result"](r.reduce(un(n["@@transducer/step"],n),t))}var e="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";return function(u,i,o){if("function"==typeof u&&(u=G(u)),Ln(o))return n(u,i,o);if("function"==typeof o.reduce)return r(u,i,o);if(null!=o[e])return t(u,i,o[e]());if("function"==typeof o.next)return t(u,i,o);throw new TypeError("reduce: list must be array or iterable")}}(),xr=function(){function n(n,t){this.xf=t,this.f=n,this.all=!0}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=function(n){return this.all&&(n=this.xf["@@transducer/step"](n,!0)),this.xf["@@transducer/result"](n)},n.prototype["@@transducer/step"]=function(n,t){return this.f(t)||(this.all=!1,n=U(this.xf["@@transducer/step"](n,!1))),n},h(function(t,r){return new n(t,r)})}(),wr=function(){function n(n,t){this.xf=t,this.f=n,this.any=!1}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=function(n){return this.any||(n=this.xf["@@transducer/step"](n,!1)),this.xf["@@transducer/result"](n)},n.prototype["@@transducer/step"]=function(n,t){return this.f(t)&&(this.any=!0,n=U(this.xf["@@transducer/step"](n,!0))),n},h(function(t,r){return new n(t,r)})}(),br=function(){function n(n,t){this.xf=t,this.n=n}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=D.result,n.prototype.step=function(n,t){return this.n>0?(this.n-=1,n):this.xf["@@transducer/step"](n,t)},h(function(t,r){return new n(t,r)})}(),jr=function(){function n(n,t){this.xf=t,this.f=n}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=D.result,n.prototype["@@transducer/step"]=function(n,t){if(this.f){if(this.f(t))return n;this.f=null}return this.xf["@@transducer/step"](n,t)},h(function(t,r){return new n(t,r)})}(),Or=function(){function n(n,t){this.xf=t,this.f=n,this.inputs={}}return n.prototype["@@transducer/init"]=D.init,n.prototype["@@transducer/result"]=function(n){var t;for(t in this.inputs)if(j(t,this.inputs)&&(n=this.xf["@@transducer/step"](n,this.inputs[t]),n["@@transducer/reduced"])){n=n["@@transducer/value"];break}return this.xf["@@transducer/result"](n)},n.prototype["@@transducer/step"]=function(n,t){var r=this.f(t);return this.inputs[r]=this.inputs[r]||[r,[]],this.inputs[r][1]=ur(t,this.inputs[r][1]),n},h(function(t,r){return new n(t,r)})}(),Ir=h(gr("all",xr,r)),Sr=h(function(n,t){return yr("and",n)?n.and(t):n&&t}),Er=h(gr("any",wr,e)),Nr=h(ur),kr=g(ir),Ar=p(function(n){return rt(2,n)}),Cr=p(function(n){return or(n,[],[])}),Mr=lr(c),Pr=function(){for(var n=arguments.length-1,t=arguments[n];--n>=0;)t=fr(arguments[n],t);return t},Tr=lr(ar),Rr=h(function(n,t){if(S(t))return f(n,t);if(yr("concat",n))return n.concat(t);throw new TypeError("can't concat "+typeof n)}),Wr=h(sr),Lr=p(function(n){return hn(n.length,n)}),Ur=h(function(n,t){for(var r=[],e=-1,u=n.length;++e<u;)sr(n[e],t)||sr(n[e],r)||(r[r.length]=n[e]);return r}),Br=h(dr),Fr=h(gr("drop",br,function(n,t){return 0>=n?t:B(t,n)})),qr=h(gr("dropWhile",jr,function(n,t){for(var r=-1,e=t.length;++r<e&&n(t[r]););return B(t,r)})),Dr=p(function(n){return yr("empty",n)?n.empty():[]}),Vr=h(gr("filter",V,m)),zr=h(gr("find",z,function(n,t){for(var r=-1,e=t.length;++r<e;)if(n(t[r]))return t[r]})),_r=h(gr("findIndex",_,function(n,t){for(var r=-1,e=t.length;++r<e;)if(n(t[r]))return r;return-1})),Hr=h(gr("findLast",H,function(n,t){for(var r=t.length;--r>=0;)if(n(t[r]))return t[r]})),Xr=h(gr("findLastIndex",X,function(n,t){for(var r=t.length;--r>=0;)if(n(t[r]))return r;return-1})),Yr=p(mr(!0)),Zr=p(function(n){return Lr(function(t,r){var e=B(arguments);return e[0]=r,e[1]=t,n.apply(this,e)})}),$r=p(w(Dn)),Gr=h(gr("groupBy",Or,function(n,t){return vr(function(t,r){var e=n(r);return t[e]=ur(r,t[e]||(t[e]=[])),t},{},t)})),Jr=it(0),Kr=g(function(n,t,r){return n=n<r.length&&n>=0?n:r.length,f(ur(t,B(r,0,n)),B(r,n))}),Qr=g(function(n,t,r){for(var e=[],u=-1;++u<t.length;)a(n,t[u],r)&&(e[e.length]=t[u]);return Yt(n,e)}),ne=h(cr("intersperse",function(n,t){for(var r=[],e=-1,u=t.length;++e<u;)e===u-1?r.push(t[e]):r.push(t[e],n);return r})),te=Lr(function(n,t,r){return r[n].apply(r,t)}),re=Lr(function(n,t){var r=B(arguments,2),e=n-r.length;return hn(e+1,function(){var n=arguments[e],u=r.concat(B(arguments,0,e));return n[t].apply(n,u)})}),ee=re(1,"join"),ue=function(){var n=!{toString:null}.propertyIsEnumerable("toString"),t=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];return p(function(r){if(Object(r)!==r)return[];if(Object.keys)return Object.keys(r);var e,u,i=[];for(e in r)j(e,r)&&(i[i.length]=e);if(n)for(u=t.length;--u>=0;)e=t[u],j(e,r)&&!sr(e,i)&&(i[i.length]=e);return i})}(),ie=it(-1),oe=function(n){return _n(it(n),function(t,r){return B(r,0,n).concat([t],B(r,n+1))})},ce=function(n){return _n(vt(n),en(n))},fe=h(gr("map",Y,M)),ae=h(function(n,t){return vr(function(r,e){return r[e]=n(t[e]),r},{},ue(t))}),se=h(function(n,t){return vr(function(r,e){return r[e]=n(t[e],e,t),r},{},ue(t))}),le=re(1,"match"),pe=pr(b,-(1/0)),he=pr(C,1/0),ge=h(o(gr("any",wr,e))),de=h(function(n,t){return yr("or",n)?n.or(t):n||t}),ye=Lr(hr(f)),me=Lr(hr(Zr(f))),ve=h(function(n,t){return vr(function(t,r){var e=t[n(r)?0:1];return e[e.length]=r,t},[[],[]],t)}),xe=function(){return Mr.apply(this,At(arguments))},we=Mr(tn(Pr),zt(At)),be=function(){return Tr.apply(this,At(arguments))},je=g(vr),Oe=h(function(n,t){return Vr(o(n),t)}),Ie=h(function(n,t){return Bt(Q(n),t)}),Se=g(cr("slice",function(n,t,r){return Array.prototype.slice.call(r,n,t)})),Ee=re(1,"split"),Ne=Se,ke=Ne(n,1/0),Ae=Ne(0),Ce=je(t,0),Me=cr("tail",function(n){return B(n,1)}),Pe=h(gr("take",Z,function(n,t){return B(t,0,n)})),Te=h(gr("takeWhile",$,function(n,t){for(var r=-1,e=t.length;++r<e&&n(t[r]););return B(t,0,r)})),Re=re(0,"toLowerCase"),We=re(0,"toUpperCase"),Le=hn(4,function(n,t,r,e){return vr(n("function"==typeof t?G(t):t),r,e)}),Ue=g(function(n,t,r){return Yt(n,f(t,r))}),Be=Yt(wn),Fe=p(mr(!1)),qe=Lr(function(n){var t=B(arguments,1),r=t.length;return Lr(rn(r,function(){for(var e=[],u=-1;++u<r;)e[u]=t[u](arguments[u]);return n.apply(this,e.concat(B(arguments,r)))}))}),De=p(function(n){for(var t=ue(n),r=t.length,e=[],u=-1;++u<r;)e[u]=n[t[u]];return e}),Ve=h(function(n,t){return Gt(ae(wn,n),t)}),ze=function Tu(n,t,r,e){var u=Vt(n);if(u!==Vt(t))return!1;if(wn(n,t))return!0;if("RegExp"==u)return n.source===t.source&&n.global===t.global&&n.ignoreCase===t.ignoreCase&&n.multiline===t.multiline&&n.sticky===t.sticky&&n.unicode===t.unicode;if(Object(n)===n){if("Date"===u&&n.getTime()!=t.getTime())return!1;var i=ue(n);if(i.length!==ue(t).length)return!1;for(var o=r.length;--o>=0;)if(r[o]===n)return e[o]===t;for(r[r.length]=n,e[e.length]=t,o=i.length;--o>=0;){var c=i[o];if(!j(c,t)||!Tu(t[c],n[c],r,e))return!1}return r.pop(),e.pop(),!0}return!1},_e=function(n,t){for(var r=ue(t),e=-1,u=r.length;++e<u;)n[r[e]]=t[r[e]];return n},He=function(n,t){return fe(vt(n),t)},Xe=function(n){return function(t){var r=function(){var r=arguments;return n(function(n){return n.apply(null,r)},t)};return arguments.length>1?r.apply(null,B(arguments,1)):rn(pe(He("length",t)),r)}},Ye=function Ru(n,t){var r=function(r){var e=t.concat([n]);return I(e,r)>=0?"<Circular>":Ru(r,e)};switch(Object.prototype.toString.call(n)){case"[object Arguments]":return"(function() { return arguments; }("+M(r,n).join(", ")+"))";case"[object Array]":return"["+M(r,n).join(", ")+"]";case"[object Boolean]":return"object"==typeof n?"new Boolean("+r(n.valueOf())+")":n.toString();case"[object Date]":return"new Date("+L(F(n))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof n?"new Number("+r(n.valueOf())+")":1/n===-(1/0)?"-0":n.toString(10);case"[object String]":return"object"==typeof n?"new String("+r(n.valueOf())+")":L(n);case"[object Undefined]":return"undefined";default:return"function"==typeof n.constructor&&"Object"!==n.constructor.name&&"function"==typeof n.toString&&"[object Object]"!==n.toString()?n.toString():"{"+M(function(t){return L(t)+": "+r(n[t])},ue(n).sort()).join(", ")+"}"}},Ze=Lr(Xe(r)),$e=Lr(Xe(e)),Ge=h(function(n,t){return yr("ap",n)?n.ap(t):vr(function(n,r){return f(n,fe(r,t))},[],n)}),Je=Lr(function(n){return n.apply(this,B(arguments,1))}),Ke=h(cr("chain",function(n,t){return Fe(M(n,t))})),Qe=g(function(n,t,r){function e(t,r){return Ge(fe(Nr,n(r)),t)}return vr(e,t([]),r)}),nu=h(function(n,t){if(n>10)throw new Error("Constructor with greater than ten arguments");return 0===n?function(){return new t}:Lr(rt(n,function(n,r,e,u,i,o,c,f,a,s){switch(arguments.length){case 1:return new t(n);case 2:return new t(n,r);case 3:return new t(n,r,e);case 4:return new t(n,r,e,u);case 5:return new t(n,r,e,u,i);case 6:return new t(n,r,e,u,i,o);case 7:return new t(n,r,e,u,i,o,c);case 8:return new t(n,r,e,u,i,o,c,f);case 9:return new t(n,r,e,u,i,o,c,f,a);case 10:return new t(n,r,e,u,i,o,c,f,a,s)}}))}),tu=h(gr("dropRepeatsWith",q,function(n,t){var r=[],e=0,u=t.length;if(0!==u)for(r[0]=t[0];++e<u;)n(ie(r),t[e])||(r[r.length]=t[e]);return r})),ru=h(function(n,t){return ze(n,t,[],[])}),eu=h(function(n,t){return _e(_e({},t),se(function(n,r){return n(t[r])},n))}),uu=p(w(ue)),iu=Se(0,-1),ou=h(function(n,t){return Be(m(Zr(sr)(n),t))}),cu=p(function(n){for(var t=ue(n),r=t.length,e=-1,u={};++e<r;){var i=t[e],o=n[i],c=j(o,u)?u[o]:u[o]=[];c[c.length]=i}return u}),fu=p(function(n){for(var t=ue(n),r=t.length,e=-1,u={};++e<r;){var i=t[e];u[n[i]]=i}return u}),au=h(function(n,t){var r=hn(n,t);return hn(n,function(){return vr(Ge,fe(r,arguments[0]),B(arguments,1))})}),su=p(function(n){return Ce(n)/n.length}),lu=p(function(n){var t=n.length;if(0===t)return NaN;var r=2-t%2,e=(t-r)/2;return su(B(n).sort(function(n,t){return t>n?-1:n>t?1:0}).slice(e,e+r))}),pu=h(function(n,t){return _e(_e({},n),t)}),hu=p(function(n){return je(pu,{},n)}),gu=h(He),du=je(P,1),yu=qe(M,dt,Cn),mu=p(function(n){return Ye(n,[])}),vu=h(Mr(Be,f)),xu=function(){var n={"@@transducer/init":Array,"@@transducer/step":function(n,t){return f(n,[t])},"@@transducer/result":O},r={"@@transducer/init":String,"@@transducer/step":t,"@@transducer/result":O},e={"@@transducer/init":Object,"@@transducer/step":function(n,t){return pu(n,Ln(t)?s(t[0],t[1]):t)},"@@transducer/result":O};return function(t){if(k(t))return t;if(Ln(t))return n;if("string"==typeof t)return r;if("object"==typeof t)return e;throw new Error("Cannot create transformer for "+t)}}(),wu=Qe(fe(Cn)),bu=p(function(n){return nu(n.length,n)}),ju=hn(3,function(n){var t=B(arguments,1);return hn(pe(gu("length",t)),function(){var r=arguments,e=this;return n.apply(e,M(function(n){return n.apply(e,r)},t))})}),Ou=p(gr("dropRepeats",q(y),tu(y))),Iu=g(function(n,t,r){return k(n)?vr(t(n),n["@@transducer/init"](),r):vr(t(xu(n)),n,r)}),Su=p(function(n){return au(n.length,n)}),Eu=p(function(n){var t={};return function(){var r=mu(arguments);return j(r,t)||(t[r]=n.apply(this,arguments)),t[r]}}),Nu={F:rr,T:er,__:n,add:J,adjust:K,all:Ir,allPass:Ze,always:Q,and:Sr,any:Er,anyPass:$e,ap:Ge,aperture:nn,append:Nr,apply:tn,arity:rn,assoc:en,assocPath:kr,binary:Ar,bind:un,both:on,call:Je,chain:Ke,clone:Cr,commute:wu,commuteMap:Qe,comparator:cn,complement:fn,compose:Mr,composeL:Pr,composeP:Tr,concat:Rr,cond:an,construct:bu,constructN:nu,contains:Wr,containsWith:sn,converge:ju,countBy:ln,createMapEntry:pn,curry:Lr,curryN:hn,dec:gn,defaultTo:dn,difference:Ur,differenceWith:yn,dissoc:mn,dissocPath:Br,divide:vn,drop:Fr,dropRepeats:Ou,dropRepeatsWith:tu,dropWhile:qr,either:xn,empty:Dr,eq:wn,eqDeep:ru,eqProps:bn,evolve:eu,filter:Vr,filterIndexed:jn,find:zr,findIndex:_r,findLast:Hr,findLastIndex:Xr,flatten:Yr,flip:Zr,forEach:On,forEachIndexed:In,fromPairs:Sn,functions:uu,functionsIn:$r,groupBy:Gr,gt:En,gte:Nn,has:kn,hasIn:An,head:Jr,identity:Cn,ifElse:Mn,inc:Pn,indexOf:Tn,init:iu,insert:Kr,insertAll:Rn,intersection:ou,intersectionWith:Qr,intersperse:ne,into:Iu,invert:cu,invertObj:fu,invoke:te,invoker:re,is:Wn,isArrayLike:Ln,isEmpty:Un,isNaN:Bn,isNil:Fn,isSet:qn,join:ee,keys:ue,keysIn:Dn,last:ie,lastIndexOf:Vn,length:zn,lens:_n,lensIndex:oe,lensOn:Hn,lensProp:ce,lift:Su,liftN:au,lt:Xn,lte:Yn,map:fe,mapAccum:Zn,mapAccumRight:$n,mapIndexed:Gn,mapObj:ae,mapObjIndexed:se,match:le,mathMod:Jn,max:pe,maxBy:Kn,mean:su,median:lu,memoize:Eu,merge:pu,mergeAll:hu,min:he,minBy:Qn,modulo:nt,multiply:tt,nAry:rt,negate:et,none:ge,not:ut,nth:it,nthArg:ot,nthChar:ct,nthCharCode:ft,of:at,omit:st,once:lt,or:de,partial:ye,partialRight:me,partition:ve,path:pt,pathEq:ht,pick:gt,pickAll:dt,pickBy:yt,pipe:xe,pipeL:we,pipeP:be,pluck:gu,prepend:mt,product:du,project:yu,prop:vt,propEq:xt,propOr:wt,props:bt,range:jt,reduce:je,reduceIndexed:Ot,reduceRight:It,reduceRightIndexed:St,reject:Oe,rejectIndexed:Et,remove:Nt,repeat:Ie,replace:kt,reverse:At,scan:Ct,slice:Se,sort:Mt,sortBy:Pt,split:Ee,strIndexOf:Tt,strLastIndexOf:Rt,substring:Ne,substringFrom:ke,substringTo:Ae,subtract:Wt,sum:Ce,tail:Me,take:Pe,takeWhile:Te,tap:Lt,test:Ut,times:Bt,toLower:Re,toPairs:Ft,toPairsIn:qt,toString:mu, | ||
toUpper:We,transduce:Le,trim:Dt,type:Vt,unapply:zt,unary:_t,uncurryN:Ht,unfold:Xt,union:vu,unionWith:Ue,uniq:Be,uniqWith:Yt,unnest:Fe,update:Zt,useWith:qe,values:De,valuesIn:$t,where:Gt,whereEq:Ve,wrap:Jt,xprod:Kt,zip:Qt,zipObj:nr,zipWith:tr};"object"==typeof exports?module.exports=Nu:"function"==typeof define&&define.amd?define(function(){return Nu}):this.R=Nu}).call(this); |
@@ -27,3 +27,3 @@ { | ||
"description": "A practical functional library for JavaScript programmers.", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"homepage": "https://www.github.com/ramda/ramda", | ||
@@ -38,3 +38,3 @@ "license": "MIT", | ||
"jshint": "grunt jshint", | ||
"test": "grunt test" | ||
"test": "grunt jshint && grunt jscs && grunt browserify:client && grunt mochaTest:unit" | ||
}, | ||
@@ -76,3 +76,3 @@ "dependencies": {}, | ||
"q": "^1.1.1", | ||
"ramda": "0.11.0", | ||
"ramda": "0.13.0", | ||
"testem": "^0.6.18", | ||
@@ -79,0 +79,0 @@ "uglify-js": "2.4.x", |
@@ -96,3 +96,3 @@ Ramda | ||
```html | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/ramda/0.13.0/ramda.min.js"></script> | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/ramda/0.14.0/ramda.min.js"></script> | ||
``` | ||
@@ -103,4 +103,4 @@ | ||
```html | ||
<script src="//cdn.jsdelivr.net/ramda/0.13.0/ramda.min.js"></script> | ||
<script src="//cdn.jsdelivr.net/ramda/0.13/ramda.min.js"></script> | ||
<script src="//cdn.jsdelivr.net/ramda/0.14.0/ramda.min.js"></script> | ||
<script src="//cdn.jsdelivr.net/ramda/0.14/ramda.min.js"></script> | ||
<script src="//cdn.jsdelivr.net/ramda/latest/ramda.min.js"></script> | ||
@@ -107,0 +107,0 @@ ``` |
var _curry2 = require('./internal/_curry2'); | ||
var _hasMethod = require('./internal/_hasMethod'); | ||
/** | ||
@@ -8,2 +10,4 @@ * A function that returns the first argument if it's falsy otherwise the second | ||
* | ||
* Dispatches to the `and` method of the first argument if applicable. | ||
* | ||
* @func | ||
@@ -18,8 +22,8 @@ * @memberOf R | ||
* | ||
* R.and(false, true); //=> true | ||
* R.and(0, []); //=> [] | ||
* R.and(null, ''); => false | ||
* R.and(false, true); //=> false | ||
* R.and(0, []); //=> 0 | ||
* R.and(null, ''); => null | ||
*/ | ||
module.exports = _curry2(function and(a, b) { | ||
return a && b; | ||
return _hasMethod('and', a) ? a.and(b) : a && b; | ||
}); |
@@ -22,11 +22,11 @@ var commuteMap = require('./commuteMap'); | ||
* | ||
* var as = [[1], [3, 4]]; | ||
* R.commute(R.of, as); //=> [[1, 3], [1, 4]] | ||
* var as = [[1], [3, 4]]; | ||
* R.commute(R.of, as); //=> [[1, 3], [1, 4]] | ||
* | ||
* var bs = [[1, 2], [3]]; | ||
* R.commute(R.of, bs); //=> [[1, 3], [2, 3]] | ||
* var bs = [[1, 2], [3]]; | ||
* R.commute(R.of, bs); //=> [[1, 3], [2, 3]] | ||
* | ||
* var cs = [[1, 2], [3, 4]]; | ||
* R.commute(R.of, cs); //=> [[1, 3], [2, 3], [1, 4], [2, 4]] | ||
* var cs = [[1, 2], [3, 4]]; | ||
* R.commute(R.of, cs); //=> [[1, 3], [2, 3], [1, 4], [2, 4]] | ||
*/ | ||
module.exports = commuteMap(map(identity)); |
@@ -26,11 +26,11 @@ var _curry3 = require('./internal/_curry3'); | ||
* | ||
* var plus10map = R.map(function(x) { return x + 10; }); | ||
* var as = [[1], [3, 4]]; | ||
* R.commuteMap(R.map(function(x) { return x + 10; }), R.of, as); //=> [[11, 13], [11, 14]] | ||
* var plus10map = R.map(function(x) { return x + 10; }); | ||
* var as = [[1], [3, 4]]; | ||
* R.commuteMap(R.map(function(x) { return x + 10; }), R.of, as); //=> [[11, 13], [11, 14]] | ||
* | ||
* var bs = [[1, 2], [3]]; | ||
* R.commuteMap(plus10map, R.of, bs); //=> [[11, 13], [12, 13]] | ||
* var bs = [[1, 2], [3]]; | ||
* R.commuteMap(plus10map, R.of, bs); //=> [[11, 13], [12, 13]] | ||
* | ||
* var cs = [[1, 2], [3, 4]]; | ||
* R.commuteMap(plus10map, R.of, cs); //=> [[11, 13], [12, 13], [11, 14], [12, 14]] | ||
* var cs = [[1, 2], [3, 4]]; | ||
* R.commuteMap(plus10map, R.of, cs); //=> [[11, 13], [12, 13], [11, 14], [12, 14]] | ||
*/ | ||
@@ -37,0 +37,0 @@ module.exports = _curry3(function commuteMap(fn, of, list) { |
@@ -7,4 +7,7 @@ var _contains = require('./internal/_contains'); | ||
* Returns `true` if the specified item is somewhere in the list, `false` otherwise. | ||
* Equivalent to `indexOf(a)(list) > -1`. Uses strict (`===`) equality checking. | ||
* Equivalent to `indexOf(a, list) >= 0`. | ||
* | ||
* Has `Object.is` semantics: `NaN` is considered equal to `NaN`; `0` and `-0` | ||
* are not considered equal. | ||
* | ||
* @func | ||
@@ -11,0 +14,0 @@ * @memberOf R |
@@ -19,6 +19,6 @@ var _containsWith = require('./internal/_containsWith'); | ||
* | ||
* var xs = [{x: 12}, {x: 11}, {x: 10}]; | ||
* R.containsWith(function(a, b) { return a.x === b.x; }, {x: 10}, xs); //=> true | ||
* R.containsWith(function(a, b) { return a.x === b.x; }, {x: 1}, xs); //=> false | ||
* var xs = [{x: 12}, {x: 11}, {x: 10}]; | ||
* R.containsWith(function(a, b) { return a.x === b.x; }, {x: 10}, xs); //=> true | ||
* R.containsWith(function(a, b) { return a.x === b.x; }, {x: 1}, xs); //=> false | ||
*/ | ||
module.exports = _curry3(_containsWith); |
var _map = require('./internal/_map'); | ||
var _slice = require('./internal/_slice'); | ||
var curryN = require('./curryN'); | ||
var max = require('./max'); | ||
var pluck = require('./pluck'); | ||
@@ -15,3 +17,3 @@ | ||
* @category Function | ||
* @sig ((*... -> c) -> (((* -> a), (* -> b), ...) -> c) | ||
* @sig (x1 -> x2 -> ... -> z) -> ((a -> b -> ... -> x1), (a -> b -> ... -> x2), ...) -> (a -> b -> ... -> z) | ||
* @param {Function} after A function. `after` will be invoked with the return values of | ||
@@ -35,8 +37,9 @@ * `fn1` and `fn2` as its arguments. | ||
var fns = _slice(arguments, 1); | ||
return function() { | ||
return curryN(max(pluck('length', fns)), function() { | ||
var args = arguments; | ||
return after.apply(this, _map(function(fn) { | ||
return fn.apply(this, args); | ||
var context = this; | ||
return after.apply(context, _map(function(fn) { | ||
return fn.apply(context, args); | ||
}, fns)); | ||
}; | ||
}); | ||
}); |
@@ -33,3 +33,3 @@ var _curry3 = require('./internal/_curry3'); | ||
if (!containsPred(first[idx], second) && !containsPred(first[idx], out)) { | ||
out[idx] = first[idx]; | ||
out[out.length] = first[idx]; | ||
} | ||
@@ -36,0 +36,0 @@ } |
@@ -8,3 +8,3 @@ var _curry2 = require('./internal/_curry2'); | ||
/** | ||
* Returns a new list containing all but the first `n` elements of the given `list`. | ||
* Returns a list containing all but the first `n` elements of the given `list`. | ||
* | ||
@@ -23,6 +23,6 @@ * Acts as a transducer if a transformer is given in list position. | ||
* | ||
* R.drop(3, [1,2,3,4,5,6,7]); //=> [4,5,6,7] | ||
* R.drop(3, [1,2,3,4,5,6,7]); //=> [4,5,6,7] | ||
*/ | ||
module.exports = _curry2(_dispatchable('drop', _xdrop, function drop(n, list) { | ||
return n < list.length ? _slice(list, n) : []; | ||
return n <= 0 ? list : _slice(list, n); | ||
})); |
var _curry2 = require('./internal/_curry2'); | ||
var _eq = require('./internal/_eq'); | ||
@@ -8,6 +9,9 @@ | ||
* | ||
* Has `Object.is` semantics: `NaN` is considered equal to `NaN`; `0` and `-0` | ||
* are not considered equal. | ||
* | ||
* @func | ||
* @memberOf R | ||
* @category Relation | ||
* @sig a -> b -> Boolean | ||
* @sig a -> a -> Boolean | ||
* @param {*} a | ||
@@ -26,8 +30,2 @@ * @param {*} b | ||
*/ | ||
module.exports = _curry2(function eq(a, b) { | ||
if (a === 0) { | ||
return 1 / a === 1 / b; | ||
} else { | ||
return a === b || (a !== a && b !== b); | ||
} | ||
}); | ||
module.exports = _curry2(_eq); |
var _curry3 = require('./internal/_curry3'); | ||
var _eq = require('./internal/_eq'); | ||
@@ -7,2 +8,5 @@ | ||
* | ||
* Has `Object.is` semantics: `NaN` is considered equal to `NaN`; `0` and `-0` | ||
* are not considered equal. | ||
* | ||
* @func | ||
@@ -25,3 +29,3 @@ * @memberOf R | ||
module.exports = _curry3(function eqProps(prop, obj1, obj2) { | ||
return obj1[prop] === obj2[prop]; | ||
return _eq(obj1[prop], obj2[prop]); | ||
}); |
@@ -25,20 +25,20 @@ var _append = require('./internal/_append'); | ||
* | ||
* var byGrade = R.groupBy(function(student) { | ||
* var score = student.score; | ||
* return score < 65 ? 'F' : | ||
* score < 70 ? 'D' : | ||
* score < 80 ? 'C' : | ||
* score < 90 ? 'B' : 'A'; | ||
* }); | ||
* var students = [{name: 'Abby', score: 84}, | ||
* {name: 'Eddy', score: 58}, | ||
* // ... | ||
* {name: 'Jack', score: 69}]; | ||
* byGrade(students); | ||
* // { | ||
* // 'A': [{name: 'Dianne', score: 99}], | ||
* // 'B': [{name: 'Abby', score: 84}] | ||
* // // ..., | ||
* // 'F': [{name: 'Eddy', score: 58}] | ||
* // } | ||
* var byGrade = R.groupBy(function(student) { | ||
* var score = student.score; | ||
* return score < 65 ? 'F' : | ||
* score < 70 ? 'D' : | ||
* score < 80 ? 'C' : | ||
* score < 90 ? 'B' : 'A'; | ||
* }); | ||
* var students = [{name: 'Abby', score: 84}, | ||
* {name: 'Eddy', score: 58}, | ||
* // ... | ||
* {name: 'Jack', score: 69}]; | ||
* byGrade(students); | ||
* // { | ||
* // 'A': [{name: 'Dianne', score: 99}], | ||
* // 'B': [{name: 'Abby', score: 84}] | ||
* // // ..., | ||
* // 'F': [{name: 'Eddy', score: 58}] | ||
* // } | ||
*/ | ||
@@ -45,0 +45,0 @@ module.exports = _curry2(_dispatchable('groupBy', _xgroupBy, function groupBy(fn, list) { |
@@ -6,6 +6,8 @@ var _curry2 = require('./internal/_curry2'); | ||
/** | ||
* Returns the position of the first occurrence of an item in an array | ||
* (by strict equality), | ||
* Returns the position of the first occurrence of an item in an array, | ||
* or -1 if the item is not included in the array. | ||
* | ||
* Has `Object.is` semantics: `NaN` is considered equal to `NaN`; `0` and `-0` | ||
* are not considered equal. | ||
* | ||
* @func | ||
@@ -12,0 +14,0 @@ * @memberOf R |
@@ -1,13 +0,4 @@ | ||
/** | ||
* Internal implementation of `indexOf`. | ||
* Returns the position of the first occurrence of an item in an array | ||
* (by strict equality), | ||
* or -1 if the item is not included in the array. | ||
* | ||
* @private | ||
* @param {Array} list The array to search | ||
* @param {*} item the item to find in the Array | ||
* @param {Number} from (optional) the index to start searching the Array | ||
* @return {Number} The index of the found item, or -1. | ||
*/ | ||
var _eq = require('./_eq'); | ||
module.exports = function _indexOf(list, item, from) { | ||
@@ -19,3 +10,3 @@ var idx = 0, len = list.length; | ||
while (idx < len) { | ||
if (list[idx] === item) { | ||
if (_eq(list[idx], item)) { | ||
return idx; | ||
@@ -22,0 +13,0 @@ } |
module.exports = function _isTransformer(obj) { | ||
return typeof obj.step === 'function' && typeof obj.result === 'function'; | ||
return typeof obj['@@transducer/step'] === 'function'; | ||
}; |
@@ -1,13 +0,4 @@ | ||
/** | ||
* Internal implementation of `lastIndexOf`. | ||
* Returns the position of the last occurrence of an item in an array | ||
* (by strict equality), | ||
* or -1 if the item is not included in the array. | ||
* | ||
* @private | ||
* @param {Array} list The array to search | ||
* @param {*} item the item to find in the Array | ||
* @param {Number} from (optional) the index to start searching the Array | ||
* @return {Number} The index of the found item, or -1. | ||
*/ | ||
var _eq = require('./_eq'); | ||
module.exports = function _lastIndexOf(list, item, from) { | ||
@@ -19,3 +10,3 @@ var idx = list.length; | ||
while (--idx >= 0) { | ||
if (list[idx] === item) { | ||
if (_eq(list[idx], item)) { | ||
return idx; | ||
@@ -22,0 +13,0 @@ } |
@@ -17,3 +17,3 @@ /** | ||
module.exports = function _path(paths, obj) { | ||
if (obj == null || paths.length === 0) { | ||
if (obj == null) { | ||
return; | ||
@@ -20,0 +20,0 @@ } else { |
@@ -1,2 +0,2 @@ | ||
var _map = require('./_map'); | ||
var map = require('../map'); | ||
var prop = require('../prop'); | ||
@@ -6,3 +6,3 @@ | ||
module.exports = function _pluck(p, list) { | ||
return _map(prop(p), list); | ||
return map(prop(p), list); | ||
}; |
@@ -10,9 +10,9 @@ var _xwrap = require('./_xwrap'); | ||
while (++idx < len) { | ||
acc = xf.step(acc, list[idx]); | ||
if (acc && acc.__transducers_reduced__) { | ||
acc = acc.value; | ||
acc = xf['@@transducer/step'](acc, list[idx]); | ||
if (acc && acc['@@transducer/reduced']) { | ||
acc = acc['@@transducer/value']; | ||
break; | ||
} | ||
} | ||
return xf.result(acc); | ||
return xf['@@transducer/result'](acc); | ||
} | ||
@@ -23,5 +23,5 @@ | ||
while (!step.done) { | ||
acc = xf.step(acc, step.value); | ||
if (acc && acc.__transducers_reduced__) { | ||
acc = acc.value; | ||
acc = xf['@@transducer/step'](acc, step.value); | ||
if (acc && acc['@@transducer/reduced']) { | ||
acc = acc['@@transducer/value']; | ||
break; | ||
@@ -31,7 +31,7 @@ } | ||
} | ||
return xf.result(acc); | ||
return xf['@@transducer/result'](acc); | ||
} | ||
function _methodReduce(xf, acc, obj) { | ||
return xf.result(obj.reduce(bind(xf.step, xf), acc)); | ||
return xf['@@transducer/result'](obj.reduce(bind(xf['@@transducer/step'], xf), acc)); | ||
} | ||
@@ -38,0 +38,0 @@ |
module.exports = function(x) { | ||
return x && x.__transducers_reduced__ ? x : {value: x, __transducers_reduced__: true}; | ||
return x && x['@@transducer/reduced'] ? x : | ||
{ | ||
'@@transducer/value': x, | ||
'@@transducer/reduced': true | ||
}; | ||
}; |
@@ -23,4 +23,6 @@ /** | ||
default: | ||
var length = Math.max(0, to - from), list = [], idx = -1; | ||
while (++idx < length) { | ||
var list = []; | ||
var idx = -1; | ||
var len = Math.max(0, Math.min(args.length, to) - from); | ||
while (++idx < len) { | ||
list[idx] = args[from + idx]; | ||
@@ -27,0 +29,0 @@ } |
@@ -12,14 +12,14 @@ var _add = require('./_add'); | ||
var _stepCatArray = { | ||
init: Array, | ||
step: function(xs, x) { return _concat(xs, [x]); }, | ||
result: _identity | ||
'@@transducer/init': Array, | ||
'@@transducer/step': function(xs, x) { return _concat(xs, [x]); }, | ||
'@@transducer/result': _identity | ||
}; | ||
var _stepCatString = { | ||
init: String, | ||
step: _add, | ||
result: _identity | ||
'@@transducer/init': String, | ||
'@@transducer/step': _add, | ||
'@@transducer/result': _identity | ||
}; | ||
var _stepCatObject = { | ||
init: Object, | ||
step: function(result, input) { | ||
'@@transducer/init': Object, | ||
'@@transducer/step': function(result, input) { | ||
return merge( | ||
@@ -30,3 +30,3 @@ result, | ||
}, | ||
result: _identity | ||
'@@transducer/result': _identity | ||
}; | ||
@@ -33,0 +33,0 @@ |
var _curry2 = require('./_curry2'); | ||
var _reduced = require('./_reduced'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -11,15 +12,13 @@ | ||
} | ||
XAll.prototype.init = function() { | ||
return this.xf.init(); | ||
}; | ||
XAll.prototype.result = function(result) { | ||
XAll.prototype['@@transducer/init'] = _xfBase.init; | ||
XAll.prototype['@@transducer/result'] = function(result) { | ||
if (this.all) { | ||
result = this.xf.step(result, true); | ||
result = this.xf['@@transducer/step'](result, true); | ||
} | ||
return this.xf.result(result); | ||
return this.xf['@@transducer/result'](result); | ||
}; | ||
XAll.prototype.step = function(result, input) { | ||
XAll.prototype['@@transducer/step'] = function(result, input) { | ||
if (!this.f(input)) { | ||
this.all = false; | ||
result = _reduced(this.xf.step(result, false)); | ||
result = _reduced(this.xf['@@transducer/step'](result, false)); | ||
} | ||
@@ -26,0 +25,0 @@ return result; |
var _curry2 = require('./_curry2'); | ||
var _reduced = require('./_reduced'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -11,15 +12,13 @@ | ||
} | ||
XAny.prototype.init = function() { | ||
return this.xf.init(); | ||
}; | ||
XAny.prototype.result = function(result) { | ||
XAny.prototype['@@transducer/init'] = _xfBase.init; | ||
XAny.prototype['@@transducer/result'] = function(result) { | ||
if (!this.any) { | ||
result = this.xf.step(result, false); | ||
result = this.xf['@@transducer/step'](result, false); | ||
} | ||
return this.xf.result(result); | ||
return this.xf['@@transducer/result'](result); | ||
}; | ||
XAny.prototype.step = function(result, input) { | ||
XAny.prototype['@@transducer/step'] = function(result, input) { | ||
if (this.f(input)) { | ||
this.any = true; | ||
result = _reduced(this.xf.step(result, true)); | ||
result = _reduced(this.xf['@@transducer/step'](result, true)); | ||
} | ||
@@ -26,0 +25,0 @@ return result; |
var _curry2 = require('./_curry2'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -9,8 +10,4 @@ | ||
} | ||
XDrop.prototype.init = function() { | ||
return this.xf.init(); | ||
}; | ||
XDrop.prototype.result = function(result) { | ||
return this.xf.result(result); | ||
}; | ||
XDrop.prototype['@@transducer/init'] = _xfBase.init; | ||
XDrop.prototype['@@transducer/result'] = _xfBase.result; | ||
XDrop.prototype.step = function(result, input) { | ||
@@ -21,3 +18,3 @@ if (this.n > 0) { | ||
} | ||
return this.xf.step(result, input); | ||
return this.xf['@@transducer/step'](result, input); | ||
}; | ||
@@ -24,0 +21,0 @@ |
var _curry2 = require('./_curry2'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -9,9 +10,5 @@ | ||
} | ||
XDropWhile.prototype.init = function() { | ||
return this.xf.init(); | ||
}; | ||
XDropWhile.prototype.result = function(result) { | ||
return this.xf.result(result); | ||
}; | ||
XDropWhile.prototype.step = function(result, input) { | ||
XDropWhile.prototype['@@transducer/init'] = _xfBase.init; | ||
XDropWhile.prototype['@@transducer/result'] = _xfBase.result; | ||
XDropWhile.prototype['@@transducer/step'] = function(result, input) { | ||
if (this.f) { | ||
@@ -23,3 +20,3 @@ if (this.f(input)) { | ||
} | ||
return this.xf.step(result, input); | ||
return this.xf['@@transducer/step'](result, input); | ||
}; | ||
@@ -26,0 +23,0 @@ |
var _curry2 = require('./_curry2'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -9,13 +10,9 @@ | ||
} | ||
XFilter.prototype.init = function() { | ||
return this.xf.init(); | ||
XFilter.prototype['@@transducer/init'] = _xfBase.init; | ||
XFilter.prototype['@@transducer/result'] = _xfBase.result; | ||
XFilter.prototype['@@transducer/step'] = function(result, input) { | ||
return this.f(input) ? this.xf['@@transducer/step'](result, input) : result; | ||
}; | ||
XFilter.prototype.result = function(result) { | ||
return this.xf.result(result); | ||
}; | ||
XFilter.prototype.step = function(result, input) { | ||
return this.f(input) ? this.xf.step(result, input) : result; | ||
}; | ||
return _curry2(function _xfilter(f, xf) { return new XFilter(f, xf); }); | ||
})(); |
var _curry2 = require('./_curry2'); | ||
var _reduced = require('./_reduced'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -11,15 +12,13 @@ | ||
} | ||
XFind.prototype.init = function() { | ||
return this.xf.init(); | ||
}; | ||
XFind.prototype.result = function(result) { | ||
XFind.prototype['@@transducer/init'] = _xfBase.init; | ||
XFind.prototype['@@transducer/result'] = function(result) { | ||
if (!this.found) { | ||
result = this.xf.step(result, void 0); | ||
result = this.xf['@@transducer/step'](result, void 0); | ||
} | ||
return this.xf.result(result); | ||
return this.xf['@@transducer/result'](result); | ||
}; | ||
XFind.prototype.step = function(result, input) { | ||
XFind.prototype['@@transducer/step'] = function(result, input) { | ||
if (this.f(input)) { | ||
this.found = true; | ||
result = _reduced(this.xf.step(result, input)); | ||
result = _reduced(this.xf['@@transducer/step'](result, input)); | ||
} | ||
@@ -26,0 +25,0 @@ return result; |
var _curry2 = require('./_curry2'); | ||
var _reduced = require('./_reduced'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -12,16 +13,14 @@ | ||
} | ||
XFindIndex.prototype.init = function() { | ||
return this.xf.init(); | ||
}; | ||
XFindIndex.prototype.result = function(result) { | ||
XFindIndex.prototype['@@transducer/init'] = _xfBase.init; | ||
XFindIndex.prototype['@@transducer/result'] = function(result) { | ||
if (!this.found) { | ||
result = this.xf.step(result, -1); | ||
result = this.xf['@@transducer/step'](result, -1); | ||
} | ||
return this.xf.result(result); | ||
return this.xf['@@transducer/result'](result); | ||
}; | ||
XFindIndex.prototype.step = function(result, input) { | ||
XFindIndex.prototype['@@transducer/step'] = function(result, input) { | ||
this.idx += 1; | ||
if (this.f(input)) { | ||
this.found = true; | ||
result = _reduced(this.xf.step(result, this.idx)); | ||
result = _reduced(this.xf['@@transducer/step'](result, this.idx)); | ||
} | ||
@@ -28,0 +27,0 @@ return result; |
var _curry2 = require('./_curry2'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -9,9 +10,7 @@ | ||
} | ||
XFindLast.prototype.init = function() { | ||
return this.xf.init(); | ||
XFindLast.prototype['@@transducer/init'] = _xfBase.init; | ||
XFindLast.prototype['@@transducer/result'] = function(result) { | ||
return this.xf['@@transducer/result'](this.xf['@@transducer/step'](result, this.last)); | ||
}; | ||
XFindLast.prototype.result = function(result) { | ||
return this.xf.result(this.xf.step(result, this.last)); | ||
}; | ||
XFindLast.prototype.step = function(result, input) { | ||
XFindLast.prototype['@@transducer/step'] = function(result, input) { | ||
if (this.f(input)) { | ||
@@ -18,0 +17,0 @@ this.last = input; |
var _curry2 = require('./_curry2'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -11,9 +12,7 @@ | ||
} | ||
XFindLastIndex.prototype.init = function() { | ||
return this.xf.init(); | ||
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.result = function(result) { | ||
return this.xf.result(this.xf.step(result, this.lastIdx)); | ||
}; | ||
XFindLastIndex.prototype.step = function(result, input) { | ||
XFindLastIndex.prototype['@@transducer/step'] = function(result, input) { | ||
this.idx += 1; | ||
@@ -20,0 +19,0 @@ if (this.f(input)) { |
var _append = require('./_append'); | ||
var _curry2 = require('./_curry2'); | ||
var _has = require('./_has'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -12,12 +13,10 @@ | ||
} | ||
XGroupBy.prototype.init = function() { | ||
return this.xf.init(); | ||
}; | ||
XGroupBy.prototype.result = function(result) { | ||
XGroupBy.prototype['@@transducer/init'] = _xfBase.init; | ||
XGroupBy.prototype['@@transducer/result'] = function(result) { | ||
var key; | ||
for (key in this.inputs) { | ||
if (_has(key, this.inputs)) { | ||
result = this.xf.step(result, this.inputs[key]); | ||
if (result.__transducers_reduced__) { | ||
result = result.value; | ||
result = this.xf['@@transducer/step'](result, this.inputs[key]); | ||
if (result['@@transducer/reduced']) { | ||
result = result['@@transducer/value']; | ||
break; | ||
@@ -27,5 +26,5 @@ } | ||
} | ||
return this.xf.result(result); | ||
return this.xf['@@transducer/result'](result); | ||
}; | ||
XGroupBy.prototype.step = function(result, input) { | ||
XGroupBy.prototype['@@transducer/step'] = function(result, input) { | ||
var key = this.f(input); | ||
@@ -32,0 +31,0 @@ this.inputs[key] = this.inputs[key] || [key, []]; |
var _curry2 = require('./_curry2'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -9,13 +10,9 @@ | ||
} | ||
XMap.prototype.init = function() { | ||
return this.xf.init(); | ||
XMap.prototype['@@transducer/init'] = _xfBase.init; | ||
XMap.prototype['@@transducer/result'] = _xfBase.result; | ||
XMap.prototype['@@transducer/step'] = function(result, input) { | ||
return this.xf['@@transducer/step'](result, this.f(input)); | ||
}; | ||
XMap.prototype.result = function(result) { | ||
return this.xf.result(result); | ||
}; | ||
XMap.prototype.step = function(result, input) { | ||
return this.xf.step(result, this.f(input)); | ||
}; | ||
return _curry2(function _xmap(f, xf) { return new XMap(f, xf); }); | ||
})(); |
var _curry2 = require('./_curry2'); | ||
var _reduced = require('./_reduced'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -10,12 +11,8 @@ | ||
} | ||
XTake.prototype.init = function() { | ||
return this.xf.init(); | ||
}; | ||
XTake.prototype.result = function(result) { | ||
return this.xf.result(result); | ||
}; | ||
XTake.prototype.step = function(result, input) { | ||
XTake.prototype['@@transducer/init'] = _xfBase.init; | ||
XTake.prototype['@@transducer/result'] = _xfBase.result; | ||
XTake.prototype['@@transducer/step'] = function(result, input) { | ||
this.n -= 1; | ||
return this.n === 0 ? _reduced(this.xf.step(result, input)) | ||
: this.xf.step(result, input); | ||
return this.n === 0 ? _reduced(this.xf['@@transducer/step'](result, input)) | ||
: this.xf['@@transducer/step'](result, input); | ||
}; | ||
@@ -22,0 +19,0 @@ |
var _curry2 = require('./_curry2'); | ||
var _reduced = require('./_reduced'); | ||
var _xfBase = require('./_xfBase'); | ||
@@ -10,13 +11,9 @@ | ||
} | ||
XTakeWhile.prototype.init = function() { | ||
return this.xf.init(); | ||
XTakeWhile.prototype['@@transducer/init'] = _xfBase.init; | ||
XTakeWhile.prototype['@@transducer/result'] = _xfBase.result; | ||
XTakeWhile.prototype['@@transducer/step'] = function(result, input) { | ||
return this.f(input) ? this.xf['@@transducer/step'](result, input) : _reduced(result); | ||
}; | ||
XTakeWhile.prototype.result = function(result) { | ||
return this.xf.result(result); | ||
}; | ||
XTakeWhile.prototype.step = function(result, input) { | ||
return this.f(input) ? this.xf.step(result, input) : _reduced(result); | ||
}; | ||
return _curry2(function _xtakeWhile(f, xf) { return new XTakeWhile(f, xf); }); | ||
})(); |
@@ -5,7 +5,7 @@ module.exports = (function() { | ||
} | ||
XWrap.prototype.init = function() { | ||
XWrap.prototype['@@transducer/init'] = function() { | ||
throw new Error('init not implemented on XWrap'); | ||
}; | ||
XWrap.prototype.result = function(acc) { return acc; }; | ||
XWrap.prototype.step = function(acc, x) { | ||
XWrap.prototype['@@transducer/result'] = function(acc) { return acc; }; | ||
XWrap.prototype['@@transducer/step'] = function(acc, x) { | ||
return this.f(acc, x); | ||
@@ -12,0 +12,0 @@ }; |
@@ -42,4 +42,4 @@ var _curry3 = require('./internal/_curry3'); | ||
module.exports = _curry3(function into(acc, xf, list) { | ||
return _isTransformer(acc) ? _reduce(xf(acc), acc.init(), list) | ||
return _isTransformer(acc) ? _reduce(xf(acc), acc['@@transducer/init'](), list) | ||
: _reduce(xf(_stepCat(acc)), acc, list); | ||
}); |
@@ -12,2 +12,3 @@ var _curry1 = require('./internal/_curry1'); | ||
* @category List | ||
* @sig * -> Boolean | ||
* @param {*} x The object to test. | ||
@@ -14,0 +15,0 @@ * @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise. |
@@ -9,2 +9,3 @@ var _curry1 = require('./internal/_curry1'); | ||
* | ||
* @deprecated since v0.14.0 | ||
* @func | ||
@@ -18,5 +19,5 @@ * @memberOf R | ||
* | ||
* R.isNaN(NaN); //=> true | ||
* R.isNaN(undefined); //=> false | ||
* R.isNaN({}); //=> false | ||
* R.isNaN(NaN); //=> true | ||
* R.isNaN(undefined); //=> false | ||
* R.isNaN({}); //=> false | ||
*/ | ||
@@ -23,0 +24,0 @@ module.exports = _curry1(function isNaN(x) { |
@@ -15,7 +15,7 @@ var _curry1 = require('./internal/_curry1'); | ||
* | ||
* R.isNil(null); //=> true | ||
* R.isNil(undefined); //=> true | ||
* R.isNil(0); //=> false | ||
* R.isNil([]); //=> false | ||
* R.isNil(null); //=> true | ||
* R.isNil(undefined); //=> true | ||
* R.isNil(0); //=> false | ||
* R.isNil([]); //=> false | ||
*/ | ||
module.exports = _curry1(function isNil(x) { return x == null; }); |
@@ -7,4 +7,6 @@ var _curry1 = require('./internal/_curry1'); | ||
* Returns `true` if all elements are unique, otherwise `false`. | ||
* Uniqueness is determined using strict equality (`===`). | ||
* | ||
* Has `Object.is` semantics: `NaN` is considered equal to `NaN`; `0` and `-0` | ||
* are not considered equal. | ||
* | ||
* @func | ||
@@ -11,0 +13,0 @@ * @memberOf R |
@@ -6,5 +6,8 @@ var _curry2 = require('./internal/_curry2'); | ||
/** | ||
* Returns the position of the last occurrence of an item (by strict equality) in | ||
* Returns the position of the last occurrence of an item in | ||
* an array, or -1 if the item is not included in the array. | ||
* | ||
* Has `Object.is` semantics: `NaN` is considered equal to `NaN`; `0` and `-0` | ||
* are not considered equal. | ||
* | ||
* @func | ||
@@ -11,0 +14,0 @@ * @memberOf R |
@@ -23,24 +23,24 @@ var _curry2 = require('./internal/_curry2'); | ||
* | ||
* var headLens = R.lens( | ||
* function get(arr) { return arr[0]; }, | ||
* function set(val, arr) { return [val].concat(arr.slice(1)); } | ||
* ); | ||
* headLens([10, 20, 30, 40]); //=> 10 | ||
* headLens.set('mu', [10, 20, 30, 40]); //=> ['mu', 20, 30, 40] | ||
* headLens.map(function(x) { return x + 1; }, [10, 20, 30, 40]); //=> [11, 20, 30, 40] | ||
* var headLens = R.lens( | ||
* function get(arr) { return arr[0]; }, | ||
* function set(val, arr) { return [val].concat(arr.slice(1)); } | ||
* ); | ||
* headLens([10, 20, 30, 40]); //=> 10 | ||
* headLens.set('mu', [10, 20, 30, 40]); //=> ['mu', 20, 30, 40] | ||
* headLens.map(function(x) { return x + 1; }, [10, 20, 30, 40]); //=> [11, 20, 30, 40] | ||
* | ||
* var phraseLens = R.lens( | ||
* function get(obj) { return obj.phrase; }, | ||
* function set(val, obj) { | ||
* var out = R.clone(obj); | ||
* out.phrase = val; | ||
* return out; | ||
* } | ||
* ); | ||
* var obj1 = { phrase: 'Absolute filth . . . and I LOVED it!'}; | ||
* var obj2 = { phrase: "What's all this, then?"}; | ||
* phraseLens(obj1); // => 'Absolute filth . . . and I LOVED it!' | ||
* phraseLens(obj2); // => "What's all this, then?" | ||
* phraseLens.set('Ooh Betty', obj1); //=> { phrase: 'Ooh Betty'} | ||
* phraseLens.map(R.toUpper, obj2); //=> { phrase: "WHAT'S ALL THIS, THEN?"} | ||
* var phraseLens = R.lens( | ||
* function get(obj) { return obj.phrase; }, | ||
* function set(val, obj) { | ||
* var out = R.clone(obj); | ||
* out.phrase = val; | ||
* return out; | ||
* } | ||
* ); | ||
* var obj1 = { phrase: 'Absolute filth . . . and I LOVED it!'}; | ||
* var obj2 = { phrase: "What's all this, then?"}; | ||
* phraseLens(obj1); // => 'Absolute filth . . . and I LOVED it!' | ||
* phraseLens(obj2); // => "What's all this, then?" | ||
* phraseLens.set('Ooh Betty', obj1); //=> { phrase: 'Ooh Betty'} | ||
* phraseLens.map(R.toUpper, obj2); //=> { phrase: "WHAT'S ALL THIS, THEN?"} | ||
*/ | ||
@@ -47,0 +47,0 @@ module.exports = _curry2(function lens(get, set) { |
@@ -10,6 +10,7 @@ var _curry3 = require('./internal/_curry3'); | ||
* @category Object | ||
* @sig {} -> ({} -> v) -> (v -> a -> *) -> (a -> b) | ||
* @sig ({} -> v) -> (v -> a -> *) -> {} -> (a -> b) | ||
* @see R.lens | ||
* @param {Function} get A function that gets a value by property name | ||
* @param {Function} set A function that sets a value by property name | ||
* @param {Object} the actual object of interest | ||
* @return {Function} the returned function has `set` and `map` properties that are | ||
@@ -19,9 +20,9 @@ * also curried functions. | ||
* | ||
* var xo = {x: 1}; | ||
* var xoLens = R.lensOn(xo, | ||
* function get(o) { return o.x; }, | ||
* function set(v) { return {x: v}; }); | ||
* xoLens(); //=> 1 | ||
* xoLens.set(1000); //=> {x: 1000} | ||
* xoLens.map(R.add(1)); //=> {x: 2} | ||
* var xo = {x: 1}; | ||
* var xoLens = R.lensOn(function get(o) { return o.x; }, | ||
* function set(v) { return {x: v}; }, | ||
* xo); | ||
* xoLens(); //=> 1 | ||
* xoLens.set(1000); //=> {x: 1000} | ||
* xoLens.map(R.add(1)); //=> {x: 2} | ||
*/ | ||
@@ -28,0 +29,0 @@ module.exports = _curry3(function lensOn(get, set, obj) { |
@@ -18,11 +18,11 @@ var _curry1 = require('./internal/_curry1'); | ||
* | ||
* var madd3 = R.lift(R.curry(function(a, b, c) { | ||
* return a + b + c; | ||
* })); | ||
* madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7] | ||
* var madd3 = R.lift(R.curry(function(a, b, c) { | ||
* return a + b + c; | ||
* })); | ||
* madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7] | ||
* | ||
* var madd5 = R.lift(R.curry(function(a, b, c, d, e) { | ||
* return a + b + c + d + e; | ||
* })); | ||
* madd5([1,2], [3], [4, 5], [6], [7, 8]); //=> [21, 22, 22, 23, 22, 23, 23, 24] | ||
* var madd5 = R.lift(R.curry(function(a, b, c, d, e) { | ||
* return a + b + c + d + e; | ||
* })); | ||
* madd5([1,2], [3], [4, 5], [6], [7, 8]); //=> [21, 22, 22, 23, 22, 23, 23, 24] | ||
*/ | ||
@@ -29,0 +29,0 @@ module.exports = _curry1(function lift(fn) { |
@@ -22,6 +22,6 @@ var _curry2 = require('./internal/_curry2'); | ||
* | ||
* var madd3 = R.liftN(3, R.curryN(3, function() { | ||
* return R.reduce(R.add, 0, arguments); | ||
* })); | ||
* madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7] | ||
* var madd3 = R.liftN(3, R.curryN(3, function() { | ||
* return R.reduce(R.add, 0, arguments); | ||
* })); | ||
* madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7] | ||
*/ | ||
@@ -28,0 +28,0 @@ module.exports = _curry2(function liftN(arity, fn) { |
@@ -12,3 +12,3 @@ var _curry2 = require('./internal/_curry2'); | ||
* @memberOf R | ||
* @category List | ||
* @category Object | ||
* @sig (v, k, {k: v} -> v) -> {k: v} -> {k: v} | ||
@@ -15,0 +15,0 @@ * @param {Function} fn A function called for each property in `obj`. Its return value will |
@@ -7,3 +7,4 @@ var _createMaxMinBy = require('./internal/_createMaxMinBy'); | ||
/** | ||
* Determines the largest of a list of items as determined by pairwise comparisons from the supplied comparator | ||
* Determines the largest of a list of items as determined by pairwise comparisons from the supplied comparator. | ||
* Note that this will return undefined if supplied an empty list. | ||
* | ||
@@ -10,0 +11,0 @@ * @func |
var _curry1 = require('./internal/_curry1'); | ||
var _has = require('./internal/_has'); | ||
var _map = require('./internal/_map'); | ||
var toString = require('./toString'); | ||
@@ -12,5 +12,2 @@ | ||
* | ||
* Note that this version of `memoize` should not be applied to functions which | ||
* take objects as arguments. | ||
* | ||
* @func | ||
@@ -34,33 +31,11 @@ * @memberOf R | ||
*/ | ||
module.exports = (function() { | ||
// Returns a string representation of the given value suitable for use as | ||
// a property name. | ||
// | ||
// > repr(42) | ||
// '42::[object Number]' | ||
var repr = function(x) { | ||
return x + '::' + Object.prototype.toString.call(x); | ||
module.exports = _curry1(function memoize(fn) { | ||
var cache = {}; | ||
return function() { | ||
var key = toString(arguments); | ||
if (!_has(key, cache)) { | ||
cache[key] = fn.apply(this, arguments); | ||
} | ||
return cache[key]; | ||
}; | ||
// Serializes an array-like object. The approach is similar to that taken | ||
// by [CANON](https://github.com/davidchambers/CANON), though it does not | ||
// differentiate between objects at all (!) and, since it is not applied | ||
// recursively, does not distinguish between [[42]] and [['42']]. | ||
// | ||
// > serialize(['foo', 42]) | ||
// '2:{foo::[object String],42::[object Number]}' | ||
var serialize = function(args) { | ||
return args.length + ':{' + _map(repr, args).join(',') + '}'; | ||
}; | ||
return _curry1(function memoize(fn) { | ||
var cache = {}; | ||
return function() { | ||
var key = serialize(arguments); | ||
if (!_has(key, cache)) { | ||
cache[key] = fn.apply(this, arguments); | ||
} | ||
return cache[key]; | ||
}; | ||
}); | ||
}()); | ||
}); |
@@ -8,2 +8,3 @@ var _createMaxMinBy = require('./internal/_createMaxMinBy'); | ||
* Determines the smallest of a list of items as determined by pairwise comparisons from the supplied comparator | ||
* Note that this will return undefined if supplied an empty list. | ||
* | ||
@@ -10,0 +11,0 @@ * @func |
@@ -14,7 +14,9 @@ var _curry1 = require('./internal/_curry1'); | ||
* @return {Boolean} the logical inverse of passed argument. | ||
* @see complement | ||
* @example | ||
* | ||
* R.and(false, true); //=> true | ||
* R.and(0, []); //=> [] | ||
* R.and(null, ''); => false | ||
* R.not(true); //=> false | ||
* R.not(false); //=> true | ||
* R.not(0); => true | ||
* R.not(1); => false | ||
*/ | ||
@@ -21,0 +23,0 @@ module.exports = _curry1(function not(a) { |
var _curry2 = require('./internal/_curry2'); | ||
var _hasMethod = require('./internal/_hasMethod'); | ||
@@ -9,2 +10,4 @@ | ||
* | ||
* Dispatches to the `or` method of the first argument if applicable. | ||
* | ||
* @func | ||
@@ -24,3 +27,3 @@ * @memberOf R | ||
module.exports = _curry2(function or(a, b) { | ||
return a || b; | ||
return _hasMethod('or', a) ? a.or(b) : a || b; | ||
}); |
var _curry3 = require('./internal/_curry3'); | ||
var _eq = require('./internal/_eq'); | ||
var _path = require('./internal/_path'); | ||
@@ -6,5 +7,8 @@ | ||
/** | ||
* Determines whether a nested path on an object has a specific value | ||
* according to strict equality ('==='). Most likely used to filter a list: | ||
* Determines whether a nested path on an object has a specific value. | ||
* Most likely used to filter a list. | ||
* | ||
* Has `Object.is` semantics: `NaN` is considered equal to `NaN`; `0` and `-0` | ||
* are not considered equal. | ||
* | ||
* @func | ||
@@ -21,11 +25,11 @@ * @memberOf R | ||
* | ||
* var user1 = { address: { zipCode: 90210 } }; | ||
* var user2 = { address: { zipCode: 55555 } }; | ||
* var user3 = { name: 'Bob' }; | ||
* var users = [ user1, user2, user3 ]; | ||
* var isFamous = R.pathEq(['address', 'zipCode'], 90210); | ||
* R.filter(isFamous, users); //=> [ user1 ] | ||
* var user1 = { address: { zipCode: 90210 } }; | ||
* var user2 = { address: { zipCode: 55555 } }; | ||
* var user3 = { name: 'Bob' }; | ||
* var users = [ user1, user2, user3 ]; | ||
* var isFamous = R.pathEq(['address', 'zipCode'], 90210); | ||
* R.filter(isFamous, users); //=> [ user1 ] | ||
*/ | ||
module.exports = _curry3(function pathEq(path, val, obj) { | ||
return _path(path, obj) === val; | ||
return _eq(_path(path, obj), val); | ||
}); |
var _curry3 = require('./internal/_curry3'); | ||
var _eq = require('./internal/_eq'); | ||
/** | ||
* Determines whether the given property of an object has a specific | ||
* value according to strict equality (`===`). Most likely used to | ||
* filter a list: | ||
* Determines whether the given property of an object has a specific value. | ||
* Most likely used to filter a list. | ||
* | ||
* Has `Object.is` semantics: `NaN` is considered equal to `NaN`; `0` and `-0` | ||
* are not considered equal. | ||
* | ||
* @func | ||
@@ -27,3 +30,3 @@ * @memberOf R | ||
module.exports = _curry3(function propEq(name, val, obj) { | ||
return obj[name] === val; | ||
return _eq(obj[name], val); | ||
}); |
@@ -10,2 +10,5 @@ var _complement = require('./internal/_complement'); | ||
* | ||
* Acts as a transducer if a transformer is given in list position. | ||
* @see R.transduce | ||
* | ||
* @func | ||
@@ -12,0 +15,0 @@ * @memberOf R |
var _curry2 = require('./internal/_curry2'); | ||
var clone = require('./clone'); | ||
var _slice = require('./internal/_slice'); | ||
@@ -23,3 +23,3 @@ | ||
module.exports = _curry2(function sort(comparator, list) { | ||
return clone(list).sort(comparator); | ||
return _slice(list).sort(comparator); | ||
}); |
@@ -32,3 +32,3 @@ var _curry2 = require('./internal/_curry2'); | ||
module.exports = _curry2(_dispatchable('take', _xtake, function take(n, list) { | ||
return _slice(list, 0, Math.min(n, list.length)); | ||
return _slice(list, 0, n); | ||
})); |
@@ -1,3 +0,3 @@ | ||
var _contains = require('./internal/_contains'); | ||
var _curry1 = require('./internal/_curry1'); | ||
var eq = require('./eq'); | ||
var uniqWith = require('./uniqWith'); | ||
@@ -22,12 +22,2 @@ | ||
*/ | ||
module.exports = _curry1(function uniq(list) { | ||
var idx = -1, len = list.length; | ||
var result = [], item; | ||
while (++idx < len) { | ||
item = list[idx]; | ||
if (!_contains(item, result)) { | ||
result[result.length] = item; | ||
} | ||
} | ||
return result; | ||
}); | ||
module.exports = uniqWith(eq); |
@@ -20,3 +20,3 @@ var _slice = require('./internal/_slice'); | ||
* @category Function | ||
* @sig ((* -> *), (* -> *)...) -> (* -> *) | ||
* @sig (x1 -> x2 -> ... -> z) -> ((a -> x1), (b -> x2), ...) -> (a -> b -> ... -> z) | ||
* @param {Function} fn The function to wrap. | ||
@@ -23,0 +23,0 @@ * @param {...Function} transformers A variable number of transformer functions |
var _curry2 = require('./internal/_curry2'); | ||
var _satisfiesSpec = require('./internal/_satisfiesSpec'); | ||
var groupBy = require('./groupBy'); | ||
var keys = require('./keys'); | ||
var _has = require('./internal/_has'); | ||
/** | ||
* Takes a spec object and a test object and returns true if the test satisfies the spec. | ||
* Any property on the spec that is not a function is interpreted as an equality | ||
* relation. | ||
* Takes a spec object and a test object; returns true if the test satisfies | ||
* the spec. Each of the spec's own properties must be a predicate function. | ||
* Each predicate is applied to the value of the corresponding property of | ||
* the test object. `where` returns true if all the predicates return true, | ||
* false otherwise. | ||
* | ||
* If the spec has a property mapped to a function, then `where` evaluates the function, passing in | ||
* the test object's value for the property in question, as well as the whole test object. | ||
* `where` is well suited to declaratively expressing constraints for other | ||
* functions such as `filter` and `find`. | ||
* | ||
* `where` is well suited to declaratively expressing constraints for other functions, e.g., | ||
* `filter`, `find`, `pickBy`, etc. | ||
* | ||
* @func | ||
* @memberOf R | ||
* @category Object | ||
* @sig {k: v} -> {k: v} -> Boolean | ||
* @sig {String: (* -> Boolean)} -> {String: *} -> Boolean | ||
* @param {Object} spec | ||
@@ -27,19 +24,23 @@ * @param {Object} testObj | ||
* | ||
* var spec = {x: 2}; | ||
* R.where(spec, {w: 10, x: 2, y: 300}); //=> true | ||
* R.where(spec, {x: 1, y: 'moo', z: true}); //=> false | ||
* // pred :: Object -> Boolean | ||
* var pred = R.where({ | ||
* a: R.eq('foo'), | ||
* b: R.complement(R.eq('bar')), | ||
* x: R.gt(_, 10), | ||
* y: R.lt(_, 20) | ||
* }); | ||
* | ||
* var spec2 = {x: function(val, obj) { return val + obj.y > 10; }}; | ||
* R.where(spec2, {x: 2, y: 7}); //=> false | ||
* R.where(spec2, {x: 3, y: 8}); //=> true | ||
* | ||
* var xs = [{x: 2, y: 1}, {x: 10, y: 2}, {x: 8, y: 3}, {x: 10, y: 4}]; | ||
* R.filter(R.where({x: 10}), xs); // ==> [{x: 10, y: 2}, {x: 10, y: 4}] | ||
* pred({a: 'foo', b: 'xxx', x: 11, y: 19}); //=> true | ||
* pred({a: 'xxx', b: 'xxx', x: 11, y: 19}); //=> false | ||
* pred({a: 'foo', b: 'bar', x: 11, y: 19}); //=> false | ||
* pred({a: 'foo', b: 'xxx', x: 10, y: 19}); //=> false | ||
* pred({a: 'foo', b: 'xxx', x: 11, y: 20}); //=> false | ||
*/ | ||
module.exports = _curry2(function where(spec, testObj) { | ||
var parsedSpec = groupBy(function(key) { | ||
return typeof spec[key] === 'function' ? 'fn' : 'obj'; | ||
}, keys(spec)); | ||
return _satisfiesSpec(spec, parsedSpec, testObj); | ||
for (var prop in spec) { | ||
if (_has(prop, spec) && !spec[prop](testObj[prop])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
}); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
542328
302
14651