partial.lenses
Advanced tools
Comparing version 14.2.0 to 14.2.1
# Partial Lenses Changelog | ||
## 14.2.1 | ||
Fixed `L.query`, `L.findWith`, and `L.orElse` (and other optics using `L.orElse` | ||
underneath including e.g. `L.choice` and `L.choices`) to pass the outer index to | ||
the optics passed as parameters. | ||
## 14.2.0 | ||
@@ -4,0 +10,0 @@ |
@@ -1070,2 +1070,12 @@ 'use strict'; | ||
var isDefinedAtU = function isDefinedAtU(o, x, i) { | ||
return void 0 !== o(x, i, Select, id); | ||
}; | ||
var isDefinedAt = function isDefinedAt(o) { | ||
return function (x, i) { | ||
return isDefinedAtU(o, x, i); | ||
}; | ||
}; | ||
var eitherU = function eitherU(t, e) { | ||
@@ -1083,3 +1093,3 @@ return function either(c) { | ||
return function orElse(x, i, C, xi2yC) { | ||
return (isDefined(prim, x) ? prim : back)(x, i, C, xi2yC); | ||
return (isDefinedAtU(prim, x, i) ? prim : back)(x, i, C, xi2yC); | ||
}; | ||
@@ -1496,3 +1506,3 @@ }; | ||
var o = toFunction(arguments[i]); | ||
r.push(satisfying(isDefined(o)), o); | ||
r.push(satisfying(isDefinedAt(o)), o); | ||
} | ||
@@ -1776,3 +1786,3 @@ return r; | ||
var oo = toFunction(o); | ||
var p = isDefined(oo); | ||
var p = isDefinedAt(oo); | ||
return [arguments.length > 1 ? find(p, arguments[1]) : find(p), oo]; | ||
@@ -1779,0 +1789,0 @@ } |
@@ -1066,2 +1066,12 @@ import { defineNameU, isString, isFunction, always, freeze, isArray, isObject, acyclicEqualsU, array0, object0, inherit, sndU, curry, curryN, assocPartialU, dissocPartialU, isNumber, constructorOf, toObject, assign, applyU, isDefined, keys, hasU, arityN, id } from 'infestines'; | ||
var isDefinedAtU = function isDefinedAtU(o, x, i) { | ||
return void 0 !== o(x, i, Select, id$1); | ||
}; | ||
var isDefinedAt = function isDefinedAt(o) { | ||
return function (x, i) { | ||
return isDefinedAtU(o, x, i); | ||
}; | ||
}; | ||
var eitherU = function eitherU(t, e) { | ||
@@ -1079,3 +1089,3 @@ return function either(c) { | ||
return function orElse(x, i, C, xi2yC) { | ||
return (isDefined$1(prim, x) ? prim : back)(x, i, C, xi2yC); | ||
return (isDefinedAtU(prim, x, i) ? prim : back)(x, i, C, xi2yC); | ||
}; | ||
@@ -1492,3 +1502,3 @@ }; | ||
var o = toFunction(arguments[i]); | ||
r.push(satisfying(isDefined$1(o)), o); | ||
r.push(satisfying(isDefinedAt(o)), o); | ||
} | ||
@@ -1772,3 +1782,3 @@ return r; | ||
var oo = toFunction(o); | ||
var p = isDefined$1(oo); | ||
var p = isDefinedAt(oo); | ||
return [arguments.length > 1 ? find(p, arguments[1]) : find(p), oo]; | ||
@@ -1775,0 +1785,0 @@ } |
@@ -1066,2 +1066,12 @@ (function (global, factory) { | ||
var isDefinedAtU = function isDefinedAtU(o, x, i) { | ||
return void 0 !== o(x, i, Select, id); | ||
}; | ||
var isDefinedAt = function isDefinedAt(o) { | ||
return function (x, i) { | ||
return isDefinedAtU(o, x, i); | ||
}; | ||
}; | ||
var eitherU = function eitherU(t, e) { | ||
@@ -1079,3 +1089,3 @@ return function either(c) { | ||
return function orElse(x, i, C, xi2yC) { | ||
return (isDefined(prim, x) ? prim : back)(x, i, C, xi2yC); | ||
return (isDefinedAtU(prim, x, i) ? prim : back)(x, i, C, xi2yC); | ||
}; | ||
@@ -1492,3 +1502,3 @@ }; | ||
var o = toFunction(arguments[i]); | ||
r.push(satisfying(isDefined(o)), o); | ||
r.push(satisfying(isDefinedAt(o)), o); | ||
} | ||
@@ -1772,3 +1782,3 @@ return r; | ||
var oo = toFunction(o); | ||
var p = isDefined(oo); | ||
var p = isDefinedAt(oo); | ||
return [arguments.length > 1 ? find(p, arguments[1]) : find(p), oo]; | ||
@@ -1775,0 +1785,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("infestines")):"function"==typeof define&&define.amd?define(["exports","infestines"],r):r(n.L={},n.I)}(this,function(n,b){"use strict";function r(n){switch(typeof n){case"boolean":case"number":case"string":return!0;default:return!1}}function e(n,r){for(var t=0,u=r.length;t<u;++t){var e=n(r[t],t);if(void 0!==e)return e}}function i(n,r,t){if(!this)return T(new i(n,r,t));this.map=n,this.of=r,this.ap=t}function o(n,r,t,u){var e=n.map,i=n.ap,o=n.of(un),c=t.length;if(e===b.sndU){for(var f=0;f<c;++f)o=i(o,r(t[f],f));return o}for(var a=un(u),s=0;s<c;++s)o=i(e(a,o),r(t[s],s));return e(on,o)}function a(n,r){var t=r.length-n;if(t<2)return t?Yn(r[n]):Un;for(var e=Yn(r[n+--t]),i=function(t,u){return function(n,r){return e(n,r,t,u)}};--t;)i=pn(Yn(r[n+t]),i);var o=Yn(r[n]);return function(n,r,t,u){return o(n,r,t,i(t,u))}}function u(n,r,t,u){for(var e,i,o=n.length,c=Array(o),f=0;f<o;++f)switch(c[f]=t,typeof(e=n[f])){case"string":t=an(e,t);break;case"number":t=ln(e,t);break;default:t=a(f,n)(t,n[f-1],Qn,r||b.always(u)),o=f}for(o===n.length&&(t=r?r(t,n[o-1]):u);0<=--o;)t=b.isString(i=n[o])?sn(i,t,c[o]):dn(i,t,c[o]);return t}function t(n,r,t,u){return Kn(n)?_n(n,0,t,u):t.of(n)}function c(n,r,t,u){return b.isArray(n)?_n(n,0,t,u):b.isObject(n)?Sr(n,r,t,u):t.of(n)}function f(n,r,u,e){return function n(r,t){return b.isArray(r)?_n(r,0,u,n):void 0!==r?e(r,t):u.of(r)}(n,r)}function s(r,n){return 1<arguments.length?bn(E,r,n):function(n){return bn(E,r,n)}}function v(r,n,t,u){var e=Kn(r)?r.length:0;return t.map(function(n){return dn(e,n,r)},u(void 0,e))}function l(o){var c=1<arguments.length?arguments[1]:{hint:0};return function(n,r,t,u){var e=Kn(n)?n:"",i=c.hint=function(n,r,t){var u=n.hint,e=t.length;e<=u&&(u=e-1),u<0&&(u=0);for(var i=u-1;0<=i&&u<e;++u,--i){if(r(t[u],u,n))return u;if(r(t[i],i,n))return i}for(;u<e;++u)if(r(t[u],u,n))return u;for(;0<=i;--i)if(r(t[i],i,n))return i;return e}(c,o,e);return t.map(function(n){return dn(i,n,e)},u(e[i],i))}}function d(){for(var n,r=arguments.length,t={},u=0;u<r;++u)t[n=arguments[u]]=n;return Ot(t)}function h(r,n){return 1<arguments.length?yn(r,n,void 0):function(n){return yn(r,n,void 0)}}var p=function(n,r){return n+r},y=function(n,r){return n*r},g=b.curry(p),m=b.curry(y),A=b.curry(function(n,r){return r/n}),j=function(n){return-n},x=function(n,r){return n<r},O=function(n,r){return r<n},I=b.curry(function(n,r){return r instanceof n}),w=Object.create,S=function(n){return b.assign(w(null),n)},U=b.freeze(S(b.object0)),k=b.curry(function(n,r,t){return t.replace(n,r)}),E=function(n){return n},R=function(n){return n},q=function(n){return n},N=function(n,r){return b.isString(n)?new RegExp(k(/[|\\{}()[\]^$+*?.]/g,"\\$&",n),r):n},M=function(r){return function(n){try{return r(n)}catch(n){return n}}},P=function(n,r){return null!=r&&b.isFunction(r.then)?r.then(n):n(r)},z=function(n){return void 0!==n?String(n):""},C=function(n,r,t,u){return void 0!==u?Math.min(Math.max(n,u<0?r+u:u),r):t},D=function(r){return function(n){return[n,r]}},L=function(r){return function(n){return void 0!==n?n:r}},W=L(0),F=b.always(!0),$=function(n){return void 0!==n?!n:n},B=function(n){return void 0!==n?[n]:n},J=function(r,t){return q(function(n){return r(n)?t(n):void 0})},T=E,_=function(n){return!(n instanceof Object)||b.isArray(n)},G=E(function(n){if(Kn(n)){for(var r=n.length,t=Array(r),u=0;r;)t[u++]=n[--r];return t}}),H=E(function(n,r,t){for(var u=r.length,e=Array(u),i=0,o=!0,c=0;c<u;++c){var f=r[c],a=n(f,c);t!==a&&(e[i++]=a,o&&(o=f===a&&(0!==f||1/f==1/a)||f!=f&&a!=a))}return i!==u?(e.length=i,e):o?r:e}),K=function(n,r){return Kn(r)?H(n,r,void 0):void 0},Q=E(function(n,r,t,u,e){for(;u<e;)n[r++]=t[u++];return n}),V=b.inherit(function n(r,t,u,e){if(!this)return T(new n(r,t,u,e));i.call(this,r,t,u),this.chain=e},i),X=function(n,r){return i(b.sndU,b.always(r),n)},Y=function(n){return X(n.concat,(0,n.empty)())},Z=X(p,0),nn=function(o){return b.curry(function(u,n,r){var e=void 0,i=void 0;return rn(Xn,function(n,r){var t=u(n,r);void 0===t||void 0!==i&&!o(t,i)||(e=n,i=t)},n,r),e})},rn=function(n,r,t,u){return Yn(t)(u,void 0,n,r)},tn=function(e,n){return b.curryN(4,q(function(t,u){return u=n(u),function(n,r){return e(rn(u,t,n,r))}}))},un=function(t){return function(r){return function(n){return t!==n?[n,r]:r}}},en=function(n,r){for(;un!==n;)r.push(n[0]),n=n[1];return r},on=E(function(n){return en(n,[]).reverse()}),cn=i(function(n,r){var t=r.p,u=r.x,e=r.c;return u=n(u),b.isFunction(u)||(t=[u,t]),{p:t,x:u,c:e}},function(n){return{p:[],x:n,c:void 0}},function(n,r){var t=void 0!==n.c?n:r;return{p:t.p,x:n.x(r.x),c:t.c}}),fn=function(i,o){return function(e){return function(r,n,t,u){return t.map(function(n){return o(e,n,r)},u(i(e,r),e))}}},an=function(n,r){return r instanceof Object?r[n]:void 0},sn=E(function(n,r,t){return void 0!==r?b.assocPartialU(n,r,t):b.dissocPartialU(n,t)||b.object0}),vn=fn(an,sn),ln=function(n,r){return Kn(r)?r[n]:void 0},dn=E(function(n,r,t){Kn(t)||(t="");var u=t.length;if(void 0!==r){for(var e=Math.max(n+1,u),i=Array(e),o=0;o<e;++o)i[o]=t[o];return i[n]=r,i}if(u<=n)return Q(Array(u),0,t,0,u);for(var c=Array(u-1),f=0;f<n;++f)c[f]=t[f];for(var a=n+1;a<u;++a)c[a-1]=t[a];return c}),hn=fn(ln,dn),pn=function(e,n){return function(t,u){return u=n(t,u),function(n,r){return e(n,r,t,u)}}},yn=E(function(n,r,t){switch(typeof n){case"string":return sn(n,r,t);case"number":return dn(n,r,t);case"object":return u(n,0,t,r);default:return 4===n.length?n(t,void 0,Qn,b.always(r)):t}}),gn=E(function(n,r,t){switch(typeof n){case"string":return sn(n,r(an(n,t),n),t);case"number":return dn(n,r(ln(n,t),n),t);case"object":return u(n,r,t);default:return 4===n.length?n(t,void 0,Qn,r):(r(n(t,void 0),void 0),t)}}),mn=function(n,r,t){return u=Yn(n)(t,void 0,Vn,r),Promise.resolve(u);var u},bn=E(function(n,r,t){switch(typeof r){case"string":return n(an(r,t),r);case"number":return n(ln(r,t),r);case"object":for(var u,e=r.length,i=0;i<e;++i)switch(typeof(u=r[i])){case"string":t=an(u,t);break;case"number":t=ln(u,t);break;default:return a(i,r)(t,r[i-1],Xn,n)}return n(t,r[e-1]);default:return n!==E&&4!==r.length?n(r(t,void 0),void 0):r(t,void 0,Xn,n)}}),An=function(e,i){return q(function(r,t,n,u){return n.map(function(n){return i(n,r,t)},u(e(r,t),t))})},jn=function(e,i){return q(function(n,r,t,u){return t.map(i,u(e(n),r))})},xn=function(n,r){return jn(J(b.isString,n),J(b.isString,r))},On=function(n,r){return jn(J(b.isNumber,n),J(b.isNumber,r))},In=E(function(n,r){var t=void 0;for(var u in n){var e=n[u],i=b.isObject(e)?In(e,r):bn(E,e,r);void 0!==i&&(t||(t={}),t[u]=i)}return t}),wn=E(function(n,r,t){for(var u in n){var e=r&&r[u],i=n[u];t=b.isObject(i)?wn(i,e,t):yn(i,e,t)}return t}),Sn=function(n){return b.constructorOf(n)!==Object?b.toObject(n):n},Un=function(n,r,t,u){return u(n,r)},kn=E(function(e){return function(n){for(var r={},t=e.length;t--;){var u=n[0];void 0!==u&&(r[e[t]]=u),n=n[1]}return r}}),En=E(function(n,r,t,u,e,i){var o=void 0,c=!0,f={};for(var a in r){o=1;var s=t[a],v=r[a](s,a,e,i);void 0!==v?(f[a]=v,c&&(c=s===v&&(0!==s||1/s==1/v)||s!=s&&v!=v)):c=!1}var l=o;for(var d in t)if(void 0===(l&&r[d])){o=1;var h=t[d],p=n(h,d,e,i);void 0!==p?(f[d]=p,c&&(c=h===p&&(0!==h||1/h==1/p)||h!=h&&p!=p)):c=!1}return o?c&&t===u?u:f:u}),Rn=function(g,m){return function(n,r,t,u){var e=n instanceof Object?Sn(n):b.object0;if(Qn===t)return En(g,m,e,n,t,u);if(Xn!==t){var i=t.map,o=t.ap,c=t.of,f=c(D),a=[];for(var s in m)a.push(s),f=o(i(D,f),m[s](e[s],s,t,u));var v=!!a.length||void 0;for(var l in e)void 0===(v&&m[l])&&(a.push(l),f=o(i(D,f),g(e[l],l,t,u)));return a.length?i(kn(a),f):c(n)}for(var d in m){var h=m[d](e[d],d,t,u);if(void 0!==h)return h}for(var p in e)if(void 0===m[p]){var y=g(e[p],p,t,u);if(void 0!==y)return y}}},qn=function(n,r,t){return b.acyclicEqualsU(t,n)?r:t},Nn=E(function(n,r,t,u){for(var e,i=0,o=r.length;i<o;++i)(n(e=r[i],i)?t:u).push(e)}),Mn=function(n){return n[0]},Pn=function(n){return n.index},zn=function(n){return Pn(n)+n[0].length},Cn=E(function(n,r){var t=r.lastIndex;r.lastIndex=zn(n);var u=r.exec(n.input);return r.lastIndex=t,u&&u[0]&&u}),Dn=function(t){return function(r){return function(n){return[t,n,r]}}},Ln=jn(J(I(Object),E(function(n){n=Sn(n);var r=[];for(var t in n)r.push([t,n[t]]);return r})),J(b.isArray,E(function(n){for(var r={},t=0,u=n.length;t<u;++t){var e=n[t];2===e.length&&(r[e[0]]=e[1])}return r}))),Wn=jn(J(I(Object),E(function(n){n=Sn(n);var r=[];for(var t in n){var u=n[t];if(b.isArray(u))for(var e=0,i=u.length;e<i;++e)r.push([t,u[e]]);else r.push([t,u])}return r})),J(b.isArray,E(function(n){for(var r=w(null),t=0,u=n.length;t<u;++t){var e=n[t];if(2===e.length){var i=e[0],o=e[1],c=r[i];void 0===c?r[i]=o:b.isArray(c)?c.push(o):r[i]=[c,o]}}return b.assign({},r)}))),Fn=E(function(n,r){if(r instanceof Object){var t={};for(var u in r=Sn(r)){var e=n(u),i=t[e];void 0===i&&(t[e]=i={}),i[u]=r[u]}return t}}),$n=E(function(i){return function(n){if(n instanceof Object){var r={};for(var t in n=Sn(n)){var u=n[t];if(u instanceof Object)for(var e in u=Sn(u))i(e)===t&&(r[e]=u[e])}return r}}}),Bn=function(i,o){return function(e){return function(n,r,t,u){return(e(n,r)?i:o)(n,r,t,u)}}},Jn=function(e,i){return i=Yn(i),e=Yn(e),function(n,r,t,u){return(_r(i,n)?i:e)(n,r,t,u)}},Tn=function(n,r,t,u){return t.of(n)},_n=function(n,r,t,u){return t===Qn?H(u,n,void 0):t===Xn?e(u,n):o(t,u,n,void 0)},Gn=function(e,i){return function(n,r,t,u){return t.chain(function(n){return i(n,r,t,u)},e(n,r,t,u))}},Hn=function(n,r){return[r,At(n)]},Kn=function(n){return n instanceof Object&&(n=n.length)===n>>0&&0<=n||b.isString(n)},Qn=V(b.applyU,E,b.applyU,b.applyU),Vn=V(P,E,function(n,r){return P(function(r){return P(function(n){return n(r)},n)},r)},P),Xn=X(function(n,r){return void 0!==n?n:r}),Yn=E(function(n){switch(typeof n){case"string":return vn(n);case"number":return hn(n);case"object":return a(0,n);default:return 4===n.length?n:(e=n,q(function(n,r,t,u){return t.map(b.always(n),u(e(n,r),r))}))}var e}),Zn=b.curry(function(n,r,t){return yn([n,xt(r)],r,t)}),nr=b.curry(gn),rr=b.curry(mn),tr=b.curry(function(n,r){return yn(n,void 0,r)}),ur=b.curry(yn),er=b.curry(rn),ir=function(e){return q(function(n,r,t,u){return Yn(e(n,r))(n,r,t,u)})},or=E(function(){for(var n=arguments.length,r=Tn;n--;){var t=arguments[n];r=t.length<2?Yn(t[0]):Bn(Yn(t[1]),r)(t[0])}return r}),cr=E(function(i){i=Yn(i);var o=arguments.length-1;if(!o)return Tn;var n=arguments[o];1===n.length?(--o,n=Yn(n[0])):n=Tn;for(var c=Array(o),f=Array(o+1),r=0;r<o;++r){var t=arguments[r+1];c[r]=t[0],f[r]=Yn(t[1])}return f[o]=n,function(n,r,t,u){var e=o;return i(n,r,Xn,function(n,r){for(var t=0;t<e;++t)if(c[t](n,r)){if(0===(e=t))return 0;break}}),f[e](n,r,t,u)}}),fr=b.curry(function(n,r,t){return Bn(Yn(r),Yn(t))(n)}),ar=b.curry(Jn),sr=b.curry(function(t,n){return[n,ir(function(n,r){return void 0!==n?t(n,r):Tn})]}),vr=Bn(Tn,Un),lr=Bn(Un,Tn),dr=lr(b.isDefined),hr=b.curry(function(e,i){return i=Yn(i),q(function(n,t,r,u){return i(n,t,r,function(n,r){return u(n,e(r,t))})})}),pr=R(hr(function(n,r){return void 0!==r?void 0!==n?[r,n]:r:n})),yr=R(hr(b.sndU)),gr=b.curry(function(n,r){return gn(n,E,r)}),mr=b.curry(function(n,r){return mn(n,E,r)}),br=E(function(){var n=arguments.length,r=Tn;if(n)for(r=Yn(arguments[--n]);n;)r=Gn(Yn(arguments[--n]),r);return r}),Ar=function(e){return function(n,r,t,u){return t.of(e)}},jr=Ar(),xr=E(b.curryN(2,function(r){return r=Yn(r),function(n){return function n(r,t){var u=w(null);for(var e in t){var i=t[e];u[e]=b.isObject(i)?n(r,i):Yn(i)}return Rn(r,u)}(r,n)}})),Or=xr(Tn),Ir=R(Yn([Ln,t])),wr=R(Yn([Ln,t,0])),Sr=R(Rn(Un,U)),Ur=function(i){return function(n,r,u,e){return function n(r,t){return i(r,t)?e(r,t):c(r,t,u,n)}(n,r)}},kr=Ur(function(n){return void 0!==n&&!b.isArray(n)&&!b.isObject(n)}),Er=b.curry(function(t,n,r){return!bn(function(n,r){if(!t(n,r))return!0},n,r)}),Rr=Er(E),qr=b.curry(function(t,n,r){return!!bn(function(n,r){if(t(n,r))return!0},n,r)}),Nr=(0,b.curry)(function(u,n,r){var e=[];return rn(Xn,function(n,r){var t=u(n,r);void 0!==t&&e.push(t)},n,r),e}),Mr=Nr(E),Pr=tn(E,Y),zr=Pr(E),Cr=b.curry(function(t,n,r){return rn(Z,function(n,r){return t(n,r)?1:0},n,r)}),Dr=Cr(b.isDefined),Lr=b.curry(function(e,n,r){var i=new Map;return rn(Xn,function(n,r){var t=e(n,r),u=i.get(t);i.set(t,void 0!==u?u+1:1)},n,r),i}),Wr=Lr(E),Fr=b.curry(function(t,u,n,r){return rn(Xn,function(n,r){u=t(u,n,r)},n,r),u}),$r=b.curry(function(n,r,t,u){var e=[],i=[];rn(Xn,function(n,r){i.push(n),e.push(r)},t,u);for(var o=i.length-1;0<=o;--o)r=n(r,i[o],e[o]);return r}),Br=b.curry(function(t,n,r){return rn(Xn,function(n,r){t(n,r)},n,r)}),Jr=b.curry(function(n,t,r,u){var e=n();return rn(Xn,function(n,r){t(e,n,r)},r,u),e}),Tr=b.curry(bn),_r=b.curry(function(n,r){return void 0!==bn(E,n,r)}),Gr=b.curry(function(n,r){return!bn(F,n,r)}),Hr=tn(z,E(function(t){return X(function(n,r){return void 0!==n?void 0!==r?n+t+r:n:r})})),Kr=Hr(E),Qr=nn(O),Vr=Qr(E),Xr=b.curry(function(u,n,r){var e=0,i=0;return rn(Xn,function(n,r){var t=u(n,r);void 0!==t&&(i+=1,e+=t)},n,r),e/i}),Yr=Xr(E),Zr=nn(x),nt=Zr(E),rt=b.curry(function(t,n,r){return!bn(function(n,r){if(t(n,r))return!0},n,r)}),tt=qr(E),ut=er(X(y,1)),et=ut(L(1)),it=s,ot=Tr,ct=er(Z),ft=ct(W),at=b.curry(An),st=at(E),vt=b.curry(function(n,r){return An(n(r),ur(r))}),lt=E(function(e){var i=L(e);return function(n,r,t,u){return t.map(i,u(void 0!==n?n:e,r))}}),dt=E(function(n){return It(n,void 0)}),ht=function(e){return function(n,r,t,u){return u(void 0!==n?e(n,r):n,r)}},pt=function(e){return function(n,r,t,u){return t.map(function(n){return void 0!==n?e(n,r):n},u(n,r))}},yt=E(function(o){return function(n,r,t,u){var e=void 0,i=b.array0;return Kn(n)&&Nn(o,n,e=[],i=[]),t.map(function(n){var r=n?n.length:0,t=i.length,u=r+t;return u===t?i:Q(Q(Array(u),0,n,0,r),r,i,0,t)},u(e,r))}}),gt=E,mt=ir(function(n){return Kn(n)&&n.length?n.length-1:0}),bt=(0,b.curry)(function(f,a){return function(u,n,r,t){var e=Kn(u),i=e&&u.length,o=C(0,i,0,f),c=C(o,i,i,a);return r.map(function(n){var r=n?n.length:0,t=o+r;return Q(Q(Q(Array(i-c+t),0,u,0,o),o,n,0,r),t,u,c,i)},t(e?Q(Array(Math.max(0,c-o)),0,u,o,c):void 0,n))}}),At=function(n){return b.isObject(n)?Ot(nr(Sr,Hn,n)):n},jt=E,xt=function(n){return d.apply(null,b.keys(n))},Ot=E(function(e){return function(r,n,t,u){return t.map(function(n){return wn(e,n,r)},u(In(e,r),n))}}),It=b.curry(function(e,i){function o(n){return qn(i,e,n)}return function(n,r,t,u){return t.map(o,u(qn(e,i,n),r))}}),wt=b.curry(jn),St=function(n){var r=h(n),e=s(n),i=function(n){return K(r,n)};return function(n,r,t,u){return t.map(i,u(K(e,n),r))}},Ut=function(e){return function(n,r,t,u){return t.map(function(n){return bn(E,e,n)},u(yn(e,n,void 0),r))}},kt=jn($,$),Et=jn(J(Kn,E(function(n){for(var r=n.length,t=Array(r),u=0;u<r;++u)t[u]=[u,n[u]];return t})),J(b.isArray,E(function(n){for(var r=n.length,t=Array(r),u=0;u<r;++u){var e=n[u];2===e.length&&(t[e[0]]=e[1])}r=t.length;for(var i=0,o=0;o<r;++o){var c=t[o];void 0!==c&&(o!==i&&(t[i]=c),++i)}return t.length=i,t}))),Rt=jn(G,G),qt=E(function(n,r,t,u){return t.map(B,u((n instanceof Object||b.isString(n))&&1===n.length?n[0]:void 0,r))}),Nt=E(function(n){var r=n||b.object0,t=r.reviver,u=r.replacer,e=r.space;return jn(J(b.isString,M(function(n){return JSON.parse(n,t)})),J(b.isDefined,function(n){return JSON.stringify(n,u,e)}))}),Mt=xn(M(decodeURI),encodeURI),Pt=jn(J(b.isString,M(decodeURIComponent)),J(r,encodeURIComponent)),zt=b.curry(function(n,r){return xn(k(N(n,"g"),r),k(N(r,"g"),n))}),Ct=E(function(r){var t=1<arguments.length?arguments[1]:r;return jn(J(b.isString,function(n){return n.split(t)}),J(b.isArray,function(n){return n.join(r)}))}),Dt=E(function(u){var t=N(1<arguments.length?arguments[1]:u,"");return jn(J(b.isString,function(n){var r=t.exec(n);return r?[n.slice(0,Pn(r)),n.slice(zn(r))]:[n,""]}),function(n){if(b.isArray(n)&&2===n.length){var r=n[0],t=n[1];return t?r+u+t:r}})}),Lt=Yn([ht(function(n){return b.isString(n)?n.replace(/\+/g,"%20"):n}),Ct("&"),St([Dt("="),St(Pt)]),Ut(Wn)]),Wt=On(j,j);n.multikeyed=Wn,n.seemsArrayLike=Kn,n.Identity=Qn,n.IdentityAsync=Vn,n.Select=Xn,n.toFunction=Yn,n.assign=Zn,n.modify=nr,n.modifyAsync=rr,n.remove=tr,n.set=ur,n.traverse=er,n.compose=function(){var n=arguments.length;if(n<2)return n?arguments[0]:Un;for(var r=Array(n);n--;)r[n]=arguments[n];return r},n.flat=function(){for(var n=[f],r=0,t=arguments.length;r<t;++r)n.push(arguments[r],f);return n},n.lazy=function(e){function i(n,r,t,u){return o(n,r,t,u)}var o=function(n,r,t,u){return(o=Yn(e(i)))(n,r,t,u)};return i},n.choices=function(n){for(var r=arguments.length,t=Array(1<r?r-1:0),u=1;u<r;u++)t[u-1]=arguments[u];return t.length?Jn(t.reduceRight(Jn),n):n},n.choose=ir,n.cond=or,n.condOf=cr,n.ifElse=fr,n.orElse=ar,n.chain=sr,n.choice=function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return r.reduceRight(Jn,Tn)},n.unless=vr,n.when=lr,n.optional=dr,n.zero=Tn,n.mapIx=function(e){return function(n,r,t,u){return u(n,e(r,n))}},n.setIx=function(e){return function(n,r,t,u){return u(n,e)}},n.tieIx=hr,n.joinIx=pr,n.skipIx=yr,n.getLog=function(n,r){var t=rn(cn,function(n){return{p:[n,un],x:n,c:n}},n,r),u=t.p,e=t.c;u=en(u,["%O"]);for(var i=2;i<u.length;++i)u[0]+=" <= %O";return console.log.apply(console,u),e},n.log=function(){var n=b.curry(function(n,r){return console.log.apply(console,Q([],0,arguments,0,arguments.length).concat([n,r])),r});return jn(n("get"),n("set"))},n.transform=gr,n.transformAsync=mr,n.seq=br,n.assignOp=function(n){return[xt(n),Ar(n)]},n.modifyOp=function(e){return function(n,r,t,u){return t.of(e(n,r))}},n.setOp=Ar,n.removeOp=jr,n.branchOr=xr,n.branch=Or,n.branches=function(){for(var n=arguments.length,r={},t=0;t<n;++t)r[arguments[t]]=Un;return Or(r)},n.elems=t,n.elemsTotal=function(n,r,t,u){return Kn(n)?t===Qn?H(u,n,H):t===Xn?e(u,n):o(t,u,n,o):t.of(n)},n.entries=Ir,n.keys=wr,n.matches=function(f){return function(r,n,t,u){if(b.isString(r)){var e=t.map;if(f.global){var i=[""];return i.input=r,i.index=0,Xn===t?function(n,r,t){for(;t=Cn(t,r);){var u=n(Mn(t),Pn(t));if(void 0!==u)return u}}(u,f,i):e((c=r,function(n){for(var r="",t=0,u=function(n){for(var r=[];Dn!==n;)r.push(n[0],n[1]),n=n[2];return r}(n),e=u.length-2;-2!==e;e+=-2){var i=u[e];r+=c.slice(t,Pn(i));var o=u[e+1];void 0!==o&&(r+=o),t=zn(i)}return r+c.slice(t)}),function(n,r,t,u,e,i){for(var o=t(Dn);i=Cn(i,e);)o=r(r(n(Dn,t(i)),o),u(Mn(i),Pn(i)));return o}(e,t.ap,t.of,u,f,i))}var o=r.match(f);if(o)return e(function(n){return r.replace(f,void 0!==n?n:"")},u(o[0],Pn(o)))}var c;return t.of(r)}},n.values=Sr,n.children=c,n.flatten=f,n.query=function(){for(var n=[],r=0,t=arguments.length;r<t;++r){var u=Yn(arguments[r]);n.push(Ur(_r(u)),u)}return n},n.satisfying=Ur,n.leafs=kr,n.all=Er,n.and=Rr,n.any=qr,n.collectAs=Nr,n.collect=Mr,n.concatAs=Pr,n.concat=zr,n.countIf=Cr,n.count=Dr,n.countsAs=Lr,n.counts=Wr,n.foldl=Fr,n.foldr=$r,n.forEach=Br,n.forEachWith=Jr,n.get=s,n.getAs=Tr,n.isDefined=_r,n.isEmpty=Gr,n.joinAs=Hr,n.join=Kr,n.maximumBy=Qr,n.maximum=Vr,n.meanAs=Xr,n.mean=Yr,n.minimumBy=Zr,n.minimum=nt,n.none=rt,n.or=tt,n.productAs=ut,n.product=et,n.select=it,n.selectAs=ot,n.sumAs=ct,n.sum=ft,n.lens=at,n.getter=function(e){return function(n,r,t,u){return u(e(n,r),r)}},n.setter=st,n.foldTraversalLens=vt,n.defaults=function(e){function i(n){return qn(e,void 0,n)}return function(n,r,t,u){return t.map(i,u(void 0!==n?n:e,r))}},n.define=lt,n.normalize=function(n){return[ht(n),pt(n)]},n.required=dt,n.reread=ht,n.rewrite=pt,n.append=v,n.filter=yt,n.find=l,n.findWith=function(n){var r=Yn(n),t=_r(r);return[1<arguments.length?l(t,arguments[1]):l(t),r]},n.first=0,n.index=gt,n.last=mt,n.prefix=function(n){return bt(0,n)},n.slice=bt,n.suffix=function(n){return bt(0===n?1/0:n?-n:0,void 0)},n.pickIn=At,n.prop=jt,n.props=d,n.propsOf=xt,n.removable=function(){function e(n){if(!(n instanceof Object))return n;for(var r=0,t=u.length;r<t;++r)if(b.hasU(u[r],n))return n}for(var n=arguments.length,u=Array(n),r=0;r<n;r++)u[r]=arguments[r];return function(n,r,t,u){return t.map(e,u(n,r))}},n.valueOr=function(e){return function(n,r,t,u){return u(null!=n?n:e,r)}},n.pick=Ot,n.replace=It,n.getInverse=h,n.iso=wt,n.array=St,n.inverse=Ut,n.complement=kt,n.identity=Un,n.is=function(r){return jn(function(n){return b.acyclicEqualsU(r,n)},function(n){return!0===n?r:void 0})},n.indexed=Et,n.reverse=Rt,n.singleton=qt,n.disjoint=function(i){return function(n,r,t,u){var e=$n(i);return t.map(e,u(Fn(i,n),r))}},n.keyed=Ln,n.json=Nt,n.uri=Mt,n.uriComponent=Pt,n.dropPrefix=function(r){return xn(function(n){return n.startsWith(r)?n.slice(r.length):void 0},function(n){return r+n})},n.dropSuffix=function(r){return xn(function(n){return n.endsWith(r)?n.slice(0,n.length-r.length):void 0},function(n){return n+r})},n.replaces=zt,n.split=Ct,n.uncouple=Dt,n.querystring=Lt,n.add=function(n){return On(g(n),g(-n))},n.divide=function(n){return On(A(n),m(n))},n.multiply=function(n){return On(m(n),A(n))},n.negate=Wt,n.subtract=function(n){return On(g(-n),g(n))},n.pointer=function(n){"#"===n[0]&&(n=decodeURIComponent(n));for(var r=n.split("/"),t=r.length,u=1;u<t;++u){var e=r[u];r[u-1]=/^(0|[1-9]\d*)$/.test(e)?fr(_,Number(e),e):"-"===e?fr(_,v,e):e.replace("~1","/").replace("~0","~")}return r.length=t-1,r},Object.defineProperty(n,"__esModule",{value:!0})}); | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("infestines")):"function"==typeof define&&define.amd?define(["exports","infestines"],r):r(n.L={},n.I)}(this,function(n,b){"use strict";function r(n){switch(typeof n){case"boolean":case"number":case"string":return!0;default:return!1}}function e(n,r){for(var t=0,u=r.length;t<u;++t){var e=n(r[t],t);if(void 0!==e)return e}}function i(n,r,t){if(!this)return T(new i(n,r,t));this.map=n,this.of=r,this.ap=t}function o(n,r,t,u){var e=n.map,i=n.ap,o=n.of(un),c=t.length;if(e===b.sndU){for(var f=0;f<c;++f)o=i(o,r(t[f],f));return o}for(var a=un(u),s=0;s<c;++s)o=i(e(a,o),r(t[s],s));return e(on,o)}function a(n,r){var t=r.length-n;if(t<2)return t?nr(r[n]):Un;for(var e=nr(r[n+--t]),i=function(t,u){return function(n,r){return e(n,r,t,u)}};--t;)i=pn(nr(r[n+t]),i);var o=nr(r[n]);return function(n,r,t,u){return o(n,r,t,i(t,u))}}function u(n,r,t,u){for(var e,i,o=n.length,c=Array(o),f=0;f<o;++f)switch(c[f]=t,typeof(e=n[f])){case"string":t=an(e,t);break;case"number":t=ln(e,t);break;default:t=a(f,n)(t,n[f-1],Xn,r||b.always(u)),o=f}for(o===n.length&&(t=r?r(t,n[o-1]):u);0<=--o;)t=b.isString(i=n[o])?sn(i,t,c[o]):dn(i,t,c[o]);return t}function t(n,r,t,u){return Vn(n)?Hn(n,0,t,u):t.of(n)}function c(n,r,t,u){return b.isArray(n)?Hn(n,0,t,u):b.isObject(n)?kr(n,r,t,u):t.of(n)}function f(n,r,u,e){return function n(r,t){return b.isArray(r)?Hn(r,0,u,n):void 0!==r?e(r,t):u.of(r)}(n,r)}function s(r,n){return 1<arguments.length?bn(E,r,n):function(n){return bn(E,r,n)}}function v(r,n,t,u){var e=Vn(r)?r.length:0;return t.map(function(n){return dn(e,n,r)},u(void 0,e))}function l(o){var c=1<arguments.length?arguments[1]:{hint:0};return function(n,r,t,u){var e=Vn(n)?n:"",i=c.hint=function(n,r,t){var u=n.hint,e=t.length;e<=u&&(u=e-1),u<0&&(u=0);for(var i=u-1;0<=i&&u<e;++u,--i){if(r(t[u],u,n))return u;if(r(t[i],i,n))return i}for(;u<e;++u)if(r(t[u],u,n))return u;for(;0<=i;--i)if(r(t[i],i,n))return i;return e}(c,o,e);return t.map(function(n){return dn(i,n,e)},u(e[i],i))}}function d(){for(var n,r=arguments.length,t={},u=0;u<r;++u)t[n=arguments[u]]=n;return wt(t)}function h(r,n){return 1<arguments.length?yn(r,n,void 0):function(n){return yn(r,n,void 0)}}var p=function(n,r){return n+r},y=function(n,r){return n*r},g=b.curry(p),m=b.curry(y),A=b.curry(function(n,r){return r/n}),j=function(n){return-n},x=function(n,r){return n<r},O=function(n,r){return r<n},I=b.curry(function(n,r){return r instanceof n}),w=Object.create,S=function(n){return b.assign(w(null),n)},U=b.freeze(S(b.object0)),k=b.curry(function(n,r,t){return t.replace(n,r)}),E=function(n){return n},R=function(n){return n},q=function(n){return n},N=function(n,r){return b.isString(n)?new RegExp(k(/[|\\{}()[\]^$+*?.]/g,"\\$&",n),r):n},M=function(r){return function(n){try{return r(n)}catch(n){return n}}},P=function(n,r){return null!=r&&b.isFunction(r.then)?r.then(n):n(r)},z=function(n){return void 0!==n?String(n):""},C=function(n,r,t,u){return void 0!==u?Math.min(Math.max(n,u<0?r+u:u),r):t},D=function(r){return function(n){return[n,r]}},L=function(r){return function(n){return void 0!==n?n:r}},W=L(0),F=b.always(!0),$=function(n){return void 0!==n?!n:n},B=function(n){return void 0!==n?[n]:n},J=function(r,t){return q(function(n){return r(n)?t(n):void 0})},T=E,_=function(n){return!(n instanceof Object)||b.isArray(n)},G=E(function(n){if(Vn(n)){for(var r=n.length,t=Array(r),u=0;r;)t[u++]=n[--r];return t}}),H=E(function(n,r,t){for(var u=r.length,e=Array(u),i=0,o=!0,c=0;c<u;++c){var f=r[c],a=n(f,c);t!==a&&(e[i++]=a,o&&(o=f===a&&(0!==f||1/f==1/a)||f!=f&&a!=a))}return i!==u?(e.length=i,e):o?r:e}),K=function(n,r){return Vn(r)?H(n,r,void 0):void 0},Q=E(function(n,r,t,u,e){for(;u<e;)n[r++]=t[u++];return n}),V=b.inherit(function n(r,t,u,e){if(!this)return T(new n(r,t,u,e));i.call(this,r,t,u),this.chain=e},i),X=function(n,r){return i(b.sndU,b.always(r),n)},Y=function(n){return X(n.concat,(0,n.empty)())},Z=X(p,0),nn=function(o){return b.curry(function(u,n,r){var e=void 0,i=void 0;return rn(Zn,function(n,r){var t=u(n,r);void 0===t||void 0!==i&&!o(t,i)||(e=n,i=t)},n,r),e})},rn=function(n,r,t,u){return nr(t)(u,void 0,n,r)},tn=function(e,n){return b.curryN(4,q(function(t,u){return u=n(u),function(n,r){return e(rn(u,t,n,r))}}))},un=function(t){return function(r){return function(n){return t!==n?[n,r]:r}}},en=function(n,r){for(;un!==n;)r.push(n[0]),n=n[1];return r},on=E(function(n){return en(n,[]).reverse()}),cn=i(function(n,r){var t=r.p,u=r.x,e=r.c;return u=n(u),b.isFunction(u)||(t=[u,t]),{p:t,x:u,c:e}},function(n){return{p:[],x:n,c:void 0}},function(n,r){var t=void 0!==n.c?n:r;return{p:t.p,x:n.x(r.x),c:t.c}}),fn=function(i,o){return function(e){return function(r,n,t,u){return t.map(function(n){return o(e,n,r)},u(i(e,r),e))}}},an=function(n,r){return r instanceof Object?r[n]:void 0},sn=E(function(n,r,t){return void 0!==r?b.assocPartialU(n,r,t):b.dissocPartialU(n,t)||b.object0}),vn=fn(an,sn),ln=function(n,r){return Vn(r)?r[n]:void 0},dn=E(function(n,r,t){Vn(t)||(t="");var u=t.length;if(void 0!==r){for(var e=Math.max(n+1,u),i=Array(e),o=0;o<e;++o)i[o]=t[o];return i[n]=r,i}if(u<=n)return Q(Array(u),0,t,0,u);for(var c=Array(u-1),f=0;f<n;++f)c[f]=t[f];for(var a=n+1;a<u;++a)c[a-1]=t[a];return c}),hn=fn(ln,dn),pn=function(e,n){return function(t,u){return u=n(t,u),function(n,r){return e(n,r,t,u)}}},yn=E(function(n,r,t){switch(typeof n){case"string":return sn(n,r,t);case"number":return dn(n,r,t);case"object":return u(n,0,t,r);default:return 4===n.length?n(t,void 0,Xn,b.always(r)):t}}),gn=E(function(n,r,t){switch(typeof n){case"string":return sn(n,r(an(n,t),n),t);case"number":return dn(n,r(ln(n,t),n),t);case"object":return u(n,r,t);default:return 4===n.length?n(t,void 0,Xn,r):(r(n(t,void 0),void 0),t)}}),mn=function(n,r,t){return u=nr(n)(t,void 0,Yn,r),Promise.resolve(u);var u},bn=E(function(n,r,t){switch(typeof r){case"string":return n(an(r,t),r);case"number":return n(ln(r,t),r);case"object":for(var u,e=r.length,i=0;i<e;++i)switch(typeof(u=r[i])){case"string":t=an(u,t);break;case"number":t=ln(u,t);break;default:return a(i,r)(t,r[i-1],Zn,n)}return n(t,r[e-1]);default:return n!==E&&4!==r.length?n(r(t,void 0),void 0):r(t,void 0,Zn,n)}}),An=function(e,i){return q(function(r,t,n,u){return n.map(function(n){return i(n,r,t)},u(e(r,t),t))})},jn=function(e,i){return q(function(n,r,t,u){return t.map(i,u(e(n),r))})},xn=function(n,r){return jn(J(b.isString,n),J(b.isString,r))},On=function(n,r){return jn(J(b.isNumber,n),J(b.isNumber,r))},In=E(function(n,r){var t=void 0;for(var u in n){var e=n[u],i=b.isObject(e)?In(e,r):bn(E,e,r);void 0!==i&&(t||(t={}),t[u]=i)}return t}),wn=E(function(n,r,t){for(var u in n){var e=r&&r[u],i=n[u];t=b.isObject(i)?wn(i,e,t):yn(i,e,t)}return t}),Sn=function(n){return b.constructorOf(n)!==Object?b.toObject(n):n},Un=function(n,r,t,u){return u(n,r)},kn=E(function(e){return function(n){for(var r={},t=e.length;t--;){var u=n[0];void 0!==u&&(r[e[t]]=u),n=n[1]}return r}}),En=E(function(n,r,t,u,e,i){var o=void 0,c=!0,f={};for(var a in r){o=1;var s=t[a],v=r[a](s,a,e,i);void 0!==v?(f[a]=v,c&&(c=s===v&&(0!==s||1/s==1/v)||s!=s&&v!=v)):c=!1}var l=o;for(var d in t)if(void 0===(l&&r[d])){o=1;var h=t[d],p=n(h,d,e,i);void 0!==p?(f[d]=p,c&&(c=h===p&&(0!==h||1/h==1/p)||h!=h&&p!=p)):c=!1}return o?c&&t===u?u:f:u}),Rn=function(g,m){return function(n,r,t,u){var e=n instanceof Object?Sn(n):b.object0;if(Xn===t)return En(g,m,e,n,t,u);if(Zn!==t){var i=t.map,o=t.ap,c=t.of,f=c(D),a=[];for(var s in m)a.push(s),f=o(i(D,f),m[s](e[s],s,t,u));var v=!!a.length||void 0;for(var l in e)void 0===(v&&m[l])&&(a.push(l),f=o(i(D,f),g(e[l],l,t,u)));return a.length?i(kn(a),f):c(n)}for(var d in m){var h=m[d](e[d],d,t,u);if(void 0!==h)return h}for(var p in e)if(void 0===m[p]){var y=g(e[p],p,t,u);if(void 0!==y)return y}}},qn=function(n,r,t){return b.acyclicEqualsU(t,n)?r:t},Nn=E(function(n,r,t,u){for(var e,i=0,o=r.length;i<o;++i)(n(e=r[i],i)?t:u).push(e)}),Mn=function(n){return n[0]},Pn=function(n){return n.index},zn=function(n){return Pn(n)+n[0].length},Cn=E(function(n,r){var t=r.lastIndex;r.lastIndex=zn(n);var u=r.exec(n.input);return r.lastIndex=t,u&&u[0]&&u}),Dn=function(t){return function(r){return function(n){return[t,n,r]}}},Ln=jn(J(I(Object),E(function(n){n=Sn(n);var r=[];for(var t in n)r.push([t,n[t]]);return r})),J(b.isArray,E(function(n){for(var r={},t=0,u=n.length;t<u;++t){var e=n[t];2===e.length&&(r[e[0]]=e[1])}return r}))),Wn=jn(J(I(Object),E(function(n){n=Sn(n);var r=[];for(var t in n){var u=n[t];if(b.isArray(u))for(var e=0,i=u.length;e<i;++e)r.push([t,u[e]]);else r.push([t,u])}return r})),J(b.isArray,E(function(n){for(var r=w(null),t=0,u=n.length;t<u;++t){var e=n[t];if(2===e.length){var i=e[0],o=e[1],c=r[i];void 0===c?r[i]=o:b.isArray(c)?c.push(o):r[i]=[c,o]}}return b.assign({},r)}))),Fn=E(function(n,r){if(r instanceof Object){var t={};for(var u in r=Sn(r)){var e=n(u),i=t[e];void 0===i&&(t[e]=i={}),i[u]=r[u]}return t}}),$n=E(function(i){return function(n){if(n instanceof Object){var r={};for(var t in n=Sn(n)){var u=n[t];if(u instanceof Object)for(var e in u=Sn(u))i(e)===t&&(r[e]=u[e])}return r}}}),Bn=function(n,r,t){return void 0!==n(r,t,Zn,E)},Jn=function(t){return function(n,r){return Bn(t,n,r)}},Tn=function(i,o){return function(e){return function(n,r,t,u){return(e(n,r)?i:o)(n,r,t,u)}}},_n=function(e,i){return i=nr(i),e=nr(e),function(n,r,t,u){return(Bn(i,n,r)?i:e)(n,r,t,u)}},Gn=function(n,r,t,u){return t.of(n)},Hn=function(n,r,t,u){return t===Xn?H(u,n,void 0):t===Zn?e(u,n):o(t,u,n,void 0)},Kn=function(e,i){return function(n,r,t,u){return t.chain(function(n){return i(n,r,t,u)},e(n,r,t,u))}},Qn=function(n,r){return[r,xt(n)]},Vn=function(n){return n instanceof Object&&(n=n.length)===n>>0&&0<=n||b.isString(n)},Xn=V(b.applyU,E,b.applyU,b.applyU),Yn=V(P,E,function(n,r){return P(function(r){return P(function(n){return n(r)},n)},r)},P),Zn=X(function(n,r){return void 0!==n?n:r}),nr=E(function(n){switch(typeof n){case"string":return vn(n);case"number":return hn(n);case"object":return a(0,n);default:return 4===n.length?n:(e=n,q(function(n,r,t,u){return t.map(b.always(n),u(e(n,r),r))}))}var e}),rr=b.curry(function(n,r,t){return yn([n,It(r)],r,t)}),tr=b.curry(gn),ur=b.curry(mn),er=b.curry(function(n,r){return yn(n,void 0,r)}),ir=b.curry(yn),or=b.curry(rn),cr=function(e){return q(function(n,r,t,u){return nr(e(n,r))(n,r,t,u)})},fr=E(function(){for(var n=arguments.length,r=Gn;n--;){var t=arguments[n];r=t.length<2?nr(t[0]):Tn(nr(t[1]),r)(t[0])}return r}),ar=E(function(i){i=nr(i);var o=arguments.length-1;if(!o)return Gn;var n=arguments[o];1===n.length?(--o,n=nr(n[0])):n=Gn;for(var c=Array(o),f=Array(o+1),r=0;r<o;++r){var t=arguments[r+1];c[r]=t[0],f[r]=nr(t[1])}return f[o]=n,function(n,r,t,u){var e=o;return i(n,r,Zn,function(n,r){for(var t=0;t<e;++t)if(c[t](n,r)){if(0===(e=t))return 0;break}}),f[e](n,r,t,u)}}),sr=b.curry(function(n,r,t){return Tn(nr(r),nr(t))(n)}),vr=b.curry(_n),lr=b.curry(function(t,n){return[n,cr(function(n,r){return void 0!==n?t(n,r):Gn})]}),dr=Tn(Gn,Un),hr=Tn(Un,Gn),pr=hr(b.isDefined),yr=b.curry(function(e,i){return i=nr(i),q(function(n,t,r,u){return i(n,t,r,function(n,r){return u(n,e(r,t))})})}),gr=R(yr(function(n,r){return void 0!==r?void 0!==n?[r,n]:r:n})),mr=R(yr(b.sndU)),br=b.curry(function(n,r){return gn(n,E,r)}),Ar=b.curry(function(n,r){return mn(n,E,r)}),jr=E(function(){var n=arguments.length,r=Gn;if(n)for(r=nr(arguments[--n]);n;)r=Kn(nr(arguments[--n]),r);return r}),xr=function(e){return function(n,r,t,u){return t.of(e)}},Or=xr(),Ir=E(b.curryN(2,function(r){return r=nr(r),function(n){return function n(r,t){var u=w(null);for(var e in t){var i=t[e];u[e]=b.isObject(i)?n(r,i):nr(i)}return Rn(r,u)}(r,n)}})),wr=Ir(Gn),Sr=R(nr([Ln,t])),Ur=R(nr([Ln,t,0])),kr=R(Rn(Un,U)),Er=function(i){return function(n,r,u,e){return function n(r,t){return i(r,t)?e(r,t):c(r,t,u,n)}(n,r)}},Rr=Er(function(n){return void 0!==n&&!b.isArray(n)&&!b.isObject(n)}),qr=b.curry(function(t,n,r){return!bn(function(n,r){if(!t(n,r))return!0},n,r)}),Nr=qr(E),Mr=b.curry(function(t,n,r){return!!bn(function(n,r){if(t(n,r))return!0},n,r)}),Pr=(0,b.curry)(function(u,n,r){var e=[];return rn(Zn,function(n,r){var t=u(n,r);void 0!==t&&e.push(t)},n,r),e}),zr=Pr(E),Cr=tn(E,Y),Dr=Cr(E),Lr=b.curry(function(t,n,r){return rn(Z,function(n,r){return t(n,r)?1:0},n,r)}),Wr=Lr(b.isDefined),Fr=b.curry(function(e,n,r){var i=new Map;return rn(Zn,function(n,r){var t=e(n,r),u=i.get(t);i.set(t,void 0!==u?u+1:1)},n,r),i}),$r=Fr(E),Br=b.curry(function(t,u,n,r){return rn(Zn,function(n,r){u=t(u,n,r)},n,r),u}),Jr=b.curry(function(n,r,t,u){var e=[],i=[];rn(Zn,function(n,r){i.push(n),e.push(r)},t,u);for(var o=i.length-1;0<=o;--o)r=n(r,i[o],e[o]);return r}),Tr=b.curry(function(t,n,r){return rn(Zn,function(n,r){t(n,r)},n,r)}),_r=b.curry(function(n,t,r,u){var e=n();return rn(Zn,function(n,r){t(e,n,r)},r,u),e}),Gr=b.curry(bn),Hr=b.curry(function(n,r){return void 0!==bn(E,n,r)}),Kr=b.curry(function(n,r){return!bn(F,n,r)}),Qr=tn(z,E(function(t){return X(function(n,r){return void 0!==n?void 0!==r?n+t+r:n:r})})),Vr=Qr(E),Xr=nn(O),Yr=Xr(E),Zr=b.curry(function(u,n,r){var e=0,i=0;return rn(Zn,function(n,r){var t=u(n,r);void 0!==t&&(i+=1,e+=t)},n,r),e/i}),nt=Zr(E),rt=nn(x),tt=rt(E),ut=b.curry(function(t,n,r){return!bn(function(n,r){if(t(n,r))return!0},n,r)}),et=Mr(E),it=or(X(y,1)),ot=it(L(1)),ct=s,ft=Gr,at=or(Z),st=at(W),vt=b.curry(An),lt=vt(E),dt=b.curry(function(n,r){return An(n(r),ir(r))}),ht=E(function(e){var i=L(e);return function(n,r,t,u){return t.map(i,u(void 0!==n?n:e,r))}}),pt=E(function(n){return St(n,void 0)}),yt=function(e){return function(n,r,t,u){return u(void 0!==n?e(n,r):n,r)}},gt=function(e){return function(n,r,t,u){return t.map(function(n){return void 0!==n?e(n,r):n},u(n,r))}},mt=E(function(o){return function(n,r,t,u){var e=void 0,i=b.array0;return Vn(n)&&Nn(o,n,e=[],i=[]),t.map(function(n){var r=n?n.length:0,t=i.length,u=r+t;return u===t?i:Q(Q(Array(u),0,n,0,r),r,i,0,t)},u(e,r))}}),bt=E,At=cr(function(n){return Vn(n)&&n.length?n.length-1:0}),jt=(0,b.curry)(function(f,a){return function(u,n,r,t){var e=Vn(u),i=e&&u.length,o=C(0,i,0,f),c=C(o,i,i,a);return r.map(function(n){var r=n?n.length:0,t=o+r;return Q(Q(Q(Array(i-c+t),0,u,0,o),o,n,0,r),t,u,c,i)},t(e?Q(Array(Math.max(0,c-o)),0,u,o,c):void 0,n))}}),xt=function(n){return b.isObject(n)?wt(tr(kr,Qn,n)):n},Ot=E,It=function(n){return d.apply(null,b.keys(n))},wt=E(function(e){return function(r,n,t,u){return t.map(function(n){return wn(e,n,r)},u(In(e,r),n))}}),St=b.curry(function(e,i){function o(n){return qn(i,e,n)}return function(n,r,t,u){return t.map(o,u(qn(e,i,n),r))}}),Ut=b.curry(jn),kt=function(n){var r=h(n),e=s(n),i=function(n){return K(r,n)};return function(n,r,t,u){return t.map(i,u(K(e,n),r))}},Et=function(e){return function(n,r,t,u){return t.map(function(n){return bn(E,e,n)},u(yn(e,n,void 0),r))}},Rt=jn($,$),qt=jn(J(Vn,E(function(n){for(var r=n.length,t=Array(r),u=0;u<r;++u)t[u]=[u,n[u]];return t})),J(b.isArray,E(function(n){for(var r=n.length,t=Array(r),u=0;u<r;++u){var e=n[u];2===e.length&&(t[e[0]]=e[1])}r=t.length;for(var i=0,o=0;o<r;++o){var c=t[o];void 0!==c&&(o!==i&&(t[i]=c),++i)}return t.length=i,t}))),Nt=jn(G,G),Mt=E(function(n,r,t,u){return t.map(B,u((n instanceof Object||b.isString(n))&&1===n.length?n[0]:void 0,r))}),Pt=E(function(n){var r=n||b.object0,t=r.reviver,u=r.replacer,e=r.space;return jn(J(b.isString,M(function(n){return JSON.parse(n,t)})),J(b.isDefined,function(n){return JSON.stringify(n,u,e)}))}),zt=xn(M(decodeURI),encodeURI),Ct=jn(J(b.isString,M(decodeURIComponent)),J(r,encodeURIComponent)),Dt=b.curry(function(n,r){return xn(k(N(n,"g"),r),k(N(r,"g"),n))}),Lt=E(function(r){var t=1<arguments.length?arguments[1]:r;return jn(J(b.isString,function(n){return n.split(t)}),J(b.isArray,function(n){return n.join(r)}))}),Wt=E(function(u){var t=N(1<arguments.length?arguments[1]:u,"");return jn(J(b.isString,function(n){var r=t.exec(n);return r?[n.slice(0,Pn(r)),n.slice(zn(r))]:[n,""]}),function(n){if(b.isArray(n)&&2===n.length){var r=n[0],t=n[1];return t?r+u+t:r}})}),Ft=nr([yt(function(n){return b.isString(n)?n.replace(/\+/g,"%20"):n}),Lt("&"),kt([Wt("="),kt(Ct)]),Et(Wn)]),$t=On(j,j);n.multikeyed=Wn,n.seemsArrayLike=Vn,n.Identity=Xn,n.IdentityAsync=Yn,n.Select=Zn,n.toFunction=nr,n.assign=rr,n.modify=tr,n.modifyAsync=ur,n.remove=er,n.set=ir,n.traverse=or,n.compose=function(){var n=arguments.length;if(n<2)return n?arguments[0]:Un;for(var r=Array(n);n--;)r[n]=arguments[n];return r},n.flat=function(){for(var n=[f],r=0,t=arguments.length;r<t;++r)n.push(arguments[r],f);return n},n.lazy=function(e){function i(n,r,t,u){return o(n,r,t,u)}var o=function(n,r,t,u){return(o=nr(e(i)))(n,r,t,u)};return i},n.choices=function(n){for(var r=arguments.length,t=Array(1<r?r-1:0),u=1;u<r;u++)t[u-1]=arguments[u];return t.length?_n(t.reduceRight(_n),n):n},n.choose=cr,n.cond=fr,n.condOf=ar,n.ifElse=sr,n.orElse=vr,n.chain=lr,n.choice=function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return r.reduceRight(_n,Gn)},n.unless=dr,n.when=hr,n.optional=pr,n.zero=Gn,n.mapIx=function(e){return function(n,r,t,u){return u(n,e(r,n))}},n.setIx=function(e){return function(n,r,t,u){return u(n,e)}},n.tieIx=yr,n.joinIx=gr,n.skipIx=mr,n.getLog=function(n,r){var t=rn(cn,function(n){return{p:[n,un],x:n,c:n}},n,r),u=t.p,e=t.c;u=en(u,["%O"]);for(var i=2;i<u.length;++i)u[0]+=" <= %O";return console.log.apply(console,u),e},n.log=function(){var n=b.curry(function(n,r){return console.log.apply(console,Q([],0,arguments,0,arguments.length).concat([n,r])),r});return jn(n("get"),n("set"))},n.transform=br,n.transformAsync=Ar,n.seq=jr,n.assignOp=function(n){return[It(n),xr(n)]},n.modifyOp=function(e){return function(n,r,t,u){return t.of(e(n,r))}},n.setOp=xr,n.removeOp=Or,n.branchOr=Ir,n.branch=wr,n.branches=function(){for(var n=arguments.length,r={},t=0;t<n;++t)r[arguments[t]]=Un;return wr(r)},n.elems=t,n.elemsTotal=function(n,r,t,u){return Vn(n)?t===Xn?H(u,n,H):t===Zn?e(u,n):o(t,u,n,o):t.of(n)},n.entries=Sr,n.keys=Ur,n.matches=function(f){return function(r,n,t,u){if(b.isString(r)){var e=t.map;if(f.global){var i=[""];return i.input=r,i.index=0,Zn===t?function(n,r,t){for(;t=Cn(t,r);){var u=n(Mn(t),Pn(t));if(void 0!==u)return u}}(u,f,i):e((c=r,function(n){for(var r="",t=0,u=function(n){for(var r=[];Dn!==n;)r.push(n[0],n[1]),n=n[2];return r}(n),e=u.length-2;-2!==e;e+=-2){var i=u[e];r+=c.slice(t,Pn(i));var o=u[e+1];void 0!==o&&(r+=o),t=zn(i)}return r+c.slice(t)}),function(n,r,t,u,e,i){for(var o=t(Dn);i=Cn(i,e);)o=r(r(n(Dn,t(i)),o),u(Mn(i),Pn(i)));return o}(e,t.ap,t.of,u,f,i))}var o=r.match(f);if(o)return e(function(n){return r.replace(f,void 0!==n?n:"")},u(o[0],Pn(o)))}var c;return t.of(r)}},n.values=kr,n.children=c,n.flatten=f,n.query=function(){for(var n=[],r=0,t=arguments.length;r<t;++r){var u=nr(arguments[r]);n.push(Er(Jn(u)),u)}return n},n.satisfying=Er,n.leafs=Rr,n.all=qr,n.and=Nr,n.any=Mr,n.collectAs=Pr,n.collect=zr,n.concatAs=Cr,n.concat=Dr,n.countIf=Lr,n.count=Wr,n.countsAs=Fr,n.counts=$r,n.foldl=Br,n.foldr=Jr,n.forEach=Tr,n.forEachWith=_r,n.get=s,n.getAs=Gr,n.isDefined=Hr,n.isEmpty=Kr,n.joinAs=Qr,n.join=Vr,n.maximumBy=Xr,n.maximum=Yr,n.meanAs=Zr,n.mean=nt,n.minimumBy=rt,n.minimum=tt,n.none=ut,n.or=et,n.productAs=it,n.product=ot,n.select=ct,n.selectAs=ft,n.sumAs=at,n.sum=st,n.lens=vt,n.getter=function(e){return function(n,r,t,u){return u(e(n,r),r)}},n.setter=lt,n.foldTraversalLens=dt,n.defaults=function(e){function i(n){return qn(e,void 0,n)}return function(n,r,t,u){return t.map(i,u(void 0!==n?n:e,r))}},n.define=ht,n.normalize=function(n){return[yt(n),gt(n)]},n.required=pt,n.reread=yt,n.rewrite=gt,n.append=v,n.filter=mt,n.find=l,n.findWith=function(n){var r=nr(n),t=Jn(r);return[1<arguments.length?l(t,arguments[1]):l(t),r]},n.first=0,n.index=bt,n.last=At,n.prefix=function(n){return jt(0,n)},n.slice=jt,n.suffix=function(n){return jt(0===n?1/0:n?-n:0,void 0)},n.pickIn=xt,n.prop=Ot,n.props=d,n.propsOf=It,n.removable=function(){function e(n){if(!(n instanceof Object))return n;for(var r=0,t=u.length;r<t;++r)if(b.hasU(u[r],n))return n}for(var n=arguments.length,u=Array(n),r=0;r<n;r++)u[r]=arguments[r];return function(n,r,t,u){return t.map(e,u(n,r))}},n.valueOr=function(e){return function(n,r,t,u){return u(null!=n?n:e,r)}},n.pick=wt,n.replace=St,n.getInverse=h,n.iso=Ut,n.array=kt,n.inverse=Et,n.complement=Rt,n.identity=Un,n.is=function(r){return jn(function(n){return b.acyclicEqualsU(r,n)},function(n){return!0===n?r:void 0})},n.indexed=qt,n.reverse=Nt,n.singleton=Mt,n.disjoint=function(i){return function(n,r,t,u){var e=$n(i);return t.map(e,u(Fn(i,n),r))}},n.keyed=Ln,n.json=Pt,n.uri=zt,n.uriComponent=Ct,n.dropPrefix=function(r){return xn(function(n){return n.startsWith(r)?n.slice(r.length):void 0},function(n){return r+n})},n.dropSuffix=function(r){return xn(function(n){return n.endsWith(r)?n.slice(0,n.length-r.length):void 0},function(n){return n+r})},n.replaces=Dt,n.split=Lt,n.uncouple=Wt,n.querystring=Ft,n.add=function(n){return On(g(n),g(-n))},n.divide=function(n){return On(A(n),m(n))},n.multiply=function(n){return On(m(n),A(n))},n.negate=$t,n.subtract=function(n){return On(g(-n),g(n))},n.pointer=function(n){"#"===n[0]&&(n=decodeURIComponent(n));for(var r=n.split("/"),t=r.length,u=1;u<t;++u){var e=r[u];r[u-1]=/^(0|[1-9]\d*)$/.test(e)?sr(_,Number(e),e):"-"===e?sr(_,v,e):e.replace("~1","/").replace("~0","~")}return r.length=t-1,r},Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "partial.lenses", | ||
"version": "14.2.0", | ||
"version": "14.2.1", | ||
"description": "Partial lenses is a comprehensive, high-performance optics library for JavaScript", | ||
@@ -5,0 +5,0 @@ "module": "dist/partial.lenses.es.js", |
@@ -882,2 +882,6 @@ import * as I from './ext/infestines' | ||
const isDefinedAtU = (o, x, i) => void 0 !== o(x, i, Select, id) | ||
const isDefinedAt = o => (x, i) => isDefinedAtU(o, x, i) | ||
const eitherU = (t, e) => | ||
@@ -894,3 +898,3 @@ function either(c) { | ||
return function orElse(x, i, C, xi2yC) { | ||
return (isDefined(prim, x) ? prim : back)(x, i, C, xi2yC) | ||
return (isDefinedAtU(prim, x, i) ? prim : back)(x, i, C, xi2yC) | ||
} | ||
@@ -1276,3 +1280,3 @@ } | ||
const o = toFunction(arguments[i]) | ||
r.push(satisfying(isDefined(o)), o) | ||
r.push(satisfying(isDefinedAt(o)), o) | ||
} | ||
@@ -1629,3 +1633,3 @@ return r | ||
const oo = toFunction(o) | ||
const p = isDefined(oo) | ||
const p = isDefinedAt(oo) | ||
return [arguments.length > 1 ? find(p, arguments[1]) : find(p), oo] | ||
@@ -1632,0 +1636,0 @@ } |
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
534613
7282