pepka 0.14.0 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs +1 -1
- package/dist/bundle.d.ts +15 -1
- package/dist/bundle.mjs +1 -1
- package/package.json +1 -1
- package/src/quick.ts +1 -1
- package/src/safe.ts +12 -12
- package/dist/bundle.dev.js +0 -625
package/dist/bundle.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=Symbol("Placeholder"),r=r=>{let t=0;for(const s of r)s!==e&&t++;return t},t=(r,t)=>{const s=r.length,o=r.slice(),p=t.length;let n=p,c=0;for(;n&&c<s;c++)o[c]===e&&(o[c]=t[p-n],n--);for(c=s;n;c++,n--)o[c]=t[p-n];return o},s=(e,o,p)=>{const n=e.length-o.length-r(p);if(n<1)return e(...t(o,p));{const r=(...r)=>s(e,t(o,p),r);return r.$args_left=n,r}},o=e=>(...t)=>e.length>r(t)?s(e,[],t):e(...t),p=r=>function(t){return t===e?r:r(t)};function n(r){return function(t,s){const o=t===e,n=arguments.length;if(1===n&&o)throw new Error("Senseless placeholder usage.");return arguments.length>1?o?p((e=>r(e,s))):r(t,s):e=>r(t,e)}}function c(e){return o(e)}const x=void 0,a=1/0,i=e=>typeof e,l=e=>null===e,u=e=>"number"==i(e),f=e=>Array.isArray(e),h=e=>"function"===i(e),d={u:"U",b:"B",n:"N",s:"S",f:"F"},m=e=>{const r=i(e);return"object"===r?l(e)?"Null":e.constructor.name:d[r[0]]+r.slice(1)},y=n(((e,r)=>m(r)===e)),g=n(((e,r)=>(r.push(e),r))),b=c(((e,r,t)=>(t[e]=r,t))),w=c(((e,r,t)=>t.reduce(e,r))),j=c(((e,r,t)=>{for(let s in t)switch(m(t[s])){case"Array":if(e>1&&"Array"===m(r[s]))switch(e){case 2:const o=r[s],p=t[s];for(const r in p)o[r]?j(e,o[r],p[r]):o[r]=p[r];break;case 3:r[s].push(...t[s])}else r[s]=t[s];break;case"Object":if("Object"===m(r[s])){j(e,r[s],t[s]);break}default:r[s]=t[s]}return r})),O=j(1),q=j(2),A=j(3),E=n(((e,r)=>{let t,s,o,p;for(t in e)s=e[t],[o,p]=h(s)?s(r):[s,r[t]],r[o]=p,t!==o&&delete r[t];return r})),k=n(((e,r)=>{const t=f(r);for(let s in r)e(r[s],s)||(t?r.splice(s,1):delete r[s]);return r})),S=n(((e,r)=>r.indexOf(e))),v=e=>(...r)=>r[e],P=n(((e,r)=>{const t=m(e);if(t===m(r)&&("Object"===t||"Array"==t)){if(l(e)||l(r))return e===r;if(e===r)return!0;for(const t of[e,r])for(const s in t)if(!(t===r&&s in e||t===e&&s in r&&P(e[s],r[s])))return!1;return!0}return e===r})),D=o(((e,r,t,s)=>e(s)?r(s):t(s))),z=c(((e,r,t)=>D(e,r,J,t))),N=(...r)=>(...t)=>{let s,o=!0;for(let p=G(r)-1;p>-1;p--)o?(o=!1,s=r[p](...t)):s=s===e?r[p]():r[p](s);return s},B=n(((e,r)=>e.bind(r))),_=n(((e,r)=>r[e])),C=n(((e,r)=>{if((e=>"string"===i(e))(r))return r.includes(e);for(const t of r)if(P(t,e))return!0;return!1})),I=c(((e,r,t)=>t.slice(e,u(r)?r:a))),T=e=>n(((r,t)=>e(t,r))),U=_(0),$=I(1,a),F=n(((e,r)=>e+r)),K=n(((e,r)=>r-e)),L=n(((e,r)=>e*r)),
|
|
1
|
+
"use strict";const e=Symbol("Placeholder"),r=r=>{let t=0;for(const s of r)s!==e&&t++;return t},t=(r,t)=>{const s=r.length,o=r.slice(),p=t.length;let n=p,c=0;for(;n&&c<s;c++)o[c]===e&&(o[c]=t[p-n],n--);for(c=s;n;c++,n--)o[c]=t[p-n];return o},s=(e,o,p)=>{const n=e.length-o.length-r(p);if(n<1)return e(...t(o,p));{const r=(...r)=>s(e,t(o,p),r);return r.$args_left=n,r}},o=e=>(...t)=>e.length>r(t)?s(e,[],t):e(...t),p=r=>function(t){return t===e?r:r(t)};function n(r){return function(t,s){const o=t===e,n=arguments.length;if(1===n&&o)throw new Error("Senseless placeholder usage.");return arguments.length>1?o?p((e=>r(e,s))):r(t,s):e=>r(t,e)}}function c(e){return o(e)}const x=void 0,a=1/0,i=e=>typeof e,l=e=>null===e,u=e=>"number"==i(e),f=e=>Array.isArray(e),h=e=>"function"===i(e),d={u:"U",b:"B",n:"N",s:"S",f:"F"},m=e=>{const r=i(e);return"object"===r?l(e)?"Null":e.constructor.name:d[r[0]]+r.slice(1)},y=n(((e,r)=>m(r)===e)),g=n(((e,r)=>(r.push(e),r))),b=c(((e,r,t)=>(t[e]=r,t))),w=c(((e,r,t)=>t.reduce(e,r))),j=c(((e,r,t)=>{for(let s in t)switch(m(t[s])){case"Array":if(e>1&&"Array"===m(r[s]))switch(e){case 2:const o=r[s],p=t[s];for(const r in p)o[r]?j(e,o[r],p[r]):o[r]=p[r];break;case 3:r[s].push(...t[s])}else r[s]=t[s];break;case"Object":if("Object"===m(r[s])){j(e,r[s],t[s]);break}default:r[s]=t[s]}return r})),O=j(1),q=j(2),A=j(3),E=n(((e,r)=>{let t,s,o,p;for(t in e)s=e[t],[o,p]=h(s)?s(r):[s,r[t]],r[o]=p,t!==o&&delete r[t];return r})),k=n(((e,r)=>{const t=f(r);for(let s in r)e(r[s],s)||(t?r.splice(s,1):delete r[s]);return r})),S=n(((e,r)=>r.indexOf(e))),v=e=>(...r)=>r[e],P=n(((e,r)=>{const t=m(e);if(t===m(r)&&("Object"===t||"Array"==t)){if(l(e)||l(r))return e===r;if(e===r)return!0;for(const t of[e,r])for(const s in t)if(!(t===r&&s in e||t===e&&s in r&&P(e[s],r[s])))return!1;return!0}return e===r})),D=o(((e,r,t,s)=>e(s)?r(s):t(s))),z=c(((e,r,t)=>D(e,r,J,t))),N=(...r)=>(...t)=>{let s,o=!0;for(let p=G(r)-1;p>-1;p--)o?(o=!1,s=r[p](...t)):s=s===e?r[p]():r[p](s);return s},B=n(((e,r)=>e.bind(r))),_=n(((e,r)=>r[e])),C=n(((e,r)=>{if((e=>"string"===i(e))(r))return r.includes(e);for(const t of r)if(P(t,e))return!0;return!1})),I=c(((e,r,t)=>t.slice(e,u(r)?r:a))),T=e=>n(((r,t)=>e(t,r))),U=_(0),$=I(1,a),F=n(((e,r)=>e+r)),K=n(((e,r)=>r-e)),L=n(((e,r)=>e*r)),W=n(((e,r)=>e/r)),X=e=>l(e)||(e=>e===x)(e),G=e=>e.length,H=e=>()=>e,J=e=>e,M=e=>!e,Q=e=>(...r)=>{const t=e(...r),s=h(t);return!s||s&&t.$args_left<=0?M(t):Q(t)},R=e=>Object.entries(e),V=n(((e,r)=>e.test(r))),Y=n(((e,r)=>(e(r),r))),Z=n(((e,r)=>[...r,e])),ee=n(((e,r)=>r.split(e))),re=H(!0),te=H(!1),se=n(((e,r)=>r(...e))),oe=n(((e,r)=>ne(F(e),r-e))),pe=n(((e,r)=>e.filter(T(C)(r)))),ne=n(((e,r)=>[...Array(r)].map(((r,t)=>e(t))))),ce=n(((e,r)=>e>r)),xe=n(((e,r)=>e<r)),ae=n(((e,r)=>r>=e)),ie=n(((e,r)=>r<=e)),le=n(((e,r)=>r.sort(e))),ue=n(((e,r)=>r.find(e))),fe=n(((e,r)=>r.findIndex(e))),he=n(((e,r)=>fe(P(e),r))),de=n(((e,r)=>{for(const[t,s]of e)if(t(r))return s(r)})),me=c(((e,r,t)=>({...t,[e]:r}))),ye=c(((e,r,t)=>N((s=>{return me(s,G(e)<2?r:ye(I(1,a,e),r,(o=t[s],l(o)||"object"!==i(o)?{}:t[s])),t);var o}),U)(e))),ge=n(((e,r)=>r.every(e))),be=n(((e,r)=>r.some(e))),we=n(((e,r)=>e.every((e=>e(r))))),je=n(((e,r)=>e.some((e=>e(r))))),Oe=n(((e,r)=>r[e])),qe=c(((e,r,t)=>P(t[e],r))),Ae=c(((e,r,t)=>P(r[e],t[e]))),Ee=c(((e,r,t)=>D(G,(()=>X(t)?e:N(D(X,H(e),(t=>Ee(e,I(1,a,r),t))),T(Oe)(t),U)(r)),H(t),r))),ke=Ee(x),Se=c(((e,r,t)=>P(ke(e,t),r))),ve=c(((e,r,t)=>P(ke(e,r),ke(e,t)))),Pe=/^(.*?)(8|16|32|64)(Clamped)?Array$/,De=(e,r=!1)=>{const t=m(e);switch(t){case"Null":case"String":case"Number":case"Boolean":case"Symbol":return e;case"Array":return r?[...e]:Ue(N(De,v(0)),e);case"Object":if(r)return{...e};const s={};for(let r in e)s[r]=De(e[r]);return s;default:return Pe.test(t)?e.constructor.from(e):e}},ze=c(((e,r,t)=>w(e,De(r),t))),Ne=n(((e,r)=>Le(e,r))),Be=n(((e,r)=>{const t={};for(const s of e)s in r&&(t[s]=r[s]);return t})),_e=n(((e,r)=>Le(((r,t)=>!C(t,e)),r))),Ce=e=>ze(((e,r)=>me(...r,e)),{},e),Ie=n(((e,r)=>r.concat(e))),Te=n(((e,r)=>r.join(e))),Ue=n(((e,r)=>r.map(e))),$e=n(((e,r)=>r.forEach(e))),Fe=c(((e,r,t)=>r(t)&&e(t))),Ke=c(((e,r,t)=>t.replace(e,r))),Le=n(((e,r)=>f(r)?r.filter(e):N(Ce,Le((([r,t])=>e(t,r))),R)(r))),We=n(((e,r)=>Object.assign({},e,r))),Xe=n(((e,r)=>O(De(e),De(r)))),Ge=n(((e,r)=>q(De(e),De(r)))),He=n(((e,r)=>A(De(e),De(r)))),Je=c(((e,r,t)=>me(e,r(t[e]),t))),Me=n(((e,r)=>E(e,Object.assign({},r)))),Qe=n(((e,r)=>Ue(((e,t)=>[e,r[t]]),e))),Re=n(((e,r)=>ze(((e,t,s)=>me(t,r[s],e)),{},e))),Ve=c(((e,r,t)=>Ue(((r,s)=>e(r,t[s])),r))),Ye=(()=>{const e=async(r,t,s)=>{s<t.length&&(await r(t[s]),await e(r,t,++s))};return n(((r,t)=>e(r,t,0)))})(),Ze=n((async(e,r)=>(await e(r),r))),er=n(((e,r)=>Promise.all(r.map(e)))),rr=(()=>{const e=async(r,t,s)=>~s?await e(r,await r[s](t),--s):t;return(...r)=>t=>e(r,t,r.length-1)})(),tr=J,sr=J,or=J,pr=Q,nr=Z;exports.F=te,exports.T=re,exports.__=e,exports.add=F,exports.all=ge,exports.allPass=we,exports.always=H,exports.any=be,exports.anyPass=je,exports.append=Z,exports.assoc=me,exports.assocPath=ye,exports.bind=B,exports.both=Fe,exports.callWith=se,exports.clone=De,exports.cloneShallow=e=>De(e,!0),exports.complement=Q,exports.compose=N,exports.composeAsync=rr,exports.concat=Ie,exports.cond=de,exports.curry=o,exports.curry2=n,exports.curry3=c,exports.divide=W,exports.echo=or,exports.empty=e=>{switch(m(e)){case"String":return"";case"Object":return{};case"Array":return[];default:return x}},exports.equals=P,exports.explore=(e,r="log")=>Y((t=>console[r](e,t))),exports.filter=Le,exports.find=ue,exports.findIndex=fe,exports.flip=T,exports.forEach=$e,exports.forEachAsync=er,exports.forEachSerial=Ye,exports.fromPairs=Ce,exports.genBy=ne,exports.getTmpl=e=>{const r=[],t=[],s=e.length;let o,p,n,c=0,x=0,a=!1,i=U(e),l=!1;for(c=0;c<s;c++)switch(o=e[c],o){case"{":if(!i){a=!0,x=c;break}case"}":if(!i){a=!1,r.push(""),t.push(e.slice(x+1,c));break}default:n=e[c+1],l="\\"===o,a||l&&("{"===n||"}"===n)||(p=r.length-1,p<0&&(r.push(""),p++),r[p]+=o),i=l}return e=>{const s=[],o=r.length-1;for(const p in r)c=+p,s.push(r[c]),c!==o&&s.push(ke(t[c].split("."),e));return s.join("")}},exports.gt=ce,exports.gte=ae,exports.head=U,exports.identity=J,exports.ifElse=D,exports.includes=C,exports.indexOf=he,exports.intersection=pe,exports.isEmpty=e=>{switch(m(e)){case"String":case"Array":return 0==G(e);case"Object":for(const r in e)return!1;return!0;default:return null}},exports.isNil=X,exports.join=Te,exports.keys=e=>Object.keys(e),exports.last=e=>e[G(e)-1],exports.length=G,exports.lt=xe,exports.lte=ie,exports.map=Ue,exports.mapKeys=Me,exports.memoize=e=>{let r,t=!1;return()=>t?r:(t=!0,r=e())},exports.mergeDeep=Xe,exports.mergeDeepAdd=He,exports.mergeDeepX=Ge,exports.mergeShallow=We,exports.mirror=tr,exports.multiply=L,exports.noop=(...e)=>{},exports.not=M,exports.notf=pr,exports.nth=_,exports.omit=_e,exports.once=e=>{let r,t=!1;return(...s)=>t?r:(t=!0,r=e(...s))},exports.overProp=Je,exports.path=ke,exports.pathEq=Se,exports.pathOr=Ee,exports.pathsEq=ve,exports.pick=Be,exports.pickBy=Ne,exports.prop=Oe,exports.propEq=qe,exports.propsEq=Ae,exports.push=nr,exports.qappend=g,exports.qassoc=b,exports.qfilter=k,exports.qindexOf=S,exports.qmapKeys=E,exports.qmergeDeep=O,exports.qmergeDeepAdd=A,exports.qmergeDeepX=q,exports.qreduce=w,exports.range=oe,exports.reduce=ze,exports.reflect=sr,exports.replace=Ke,exports.reverse=e=>N((r=>ze(((t,s,o)=>g(e[r-o],t)),[],e)),F(-1),G)(e),exports.sizeof=e=>{if("Object"===m(e)){let r=0;for(let t in e)r++;return r}return G(e)},exports.slice=I,exports.sort=le,exports.split=ee,exports.subtract=K,exports.tail=$,exports.take=v,exports.tap=Y,exports.test=V,exports.toLower=e=>e.toLowerCase(),exports.toPairs=R,exports.toUpper=e=>e.toUpperCase(),exports.trim=e=>e.trim(),exports.type=m,exports.typeIs=y,exports.uncurry=e=>(...r)=>w(((e,r)=>e?e(r):e),e,r),exports.uniq=e=>w(((e,r)=>C(r,e)?e:g(r,e)),[],e),exports.values=e=>Object.values(e),exports.waitAll=e=>Promise.all(e),exports.waitTap=Ze,exports.when=z,exports.zip=Qe,exports.zipObj=Re,exports.zipWith=Ve;
|
package/dist/bundle.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export declare const flip: <T extends AnyFunc<any, AnyArgs>>(fn: T) => {
|
|
|
67
67
|
(a: Parameters<T>[1]): (b: Parameters<T>[0]) => any;
|
|
68
68
|
(a: Parameters<T>[1], b: Parameters<T>[0]): any;
|
|
69
69
|
};
|
|
70
|
-
export declare const head: (
|
|
70
|
+
export declare const head: <T = any>(xs: string | T[]) => T;
|
|
71
71
|
export declare const tail: any;
|
|
72
72
|
export declare const add: {
|
|
73
73
|
(a: symbol, b: number): (a: number) => number;
|
|
@@ -133,6 +133,13 @@ export declare const split: {
|
|
|
133
133
|
};
|
|
134
134
|
export declare const T: (...args: any[]) => true;
|
|
135
135
|
export declare const F: (...args: any[]) => false;
|
|
136
|
+
export declare const callWith: {
|
|
137
|
+
(a: symbol, b: AnyFunc<any, AnyArgs>): (a: any[]) => any;
|
|
138
|
+
(a: any[], b: symbol): (b: AnyFunc<any, AnyArgs>) => any;
|
|
139
|
+
(a: any[]): (b: AnyFunc<any, AnyArgs>) => any;
|
|
140
|
+
(a: any[], b: AnyFunc<any, AnyArgs>): any;
|
|
141
|
+
};
|
|
142
|
+
export declare const noop: (..._args: any[]) => void;
|
|
136
143
|
export declare const sizeof: (s: any[] | string | AnyObject) => number;
|
|
137
144
|
export declare const range: {
|
|
138
145
|
(a: symbol, b: number): (a: number) => any[];
|
|
@@ -411,6 +418,13 @@ export declare const composeAsync: <T = any>(...fns: AnyFunc[]) => (data?: any)
|
|
|
411
418
|
export declare const mirror: (s: any) => any;
|
|
412
419
|
export declare const reflect: (s: any) => any;
|
|
413
420
|
export declare const echo: (s: any) => any;
|
|
421
|
+
export declare const notf: (fn: AnyFunc) => (...args: any) => boolean | any;
|
|
422
|
+
export declare const push: {
|
|
423
|
+
(a: symbol, b: any[]): (a: any) => any[];
|
|
424
|
+
(a: any, b: symbol): (b: any[]) => any[];
|
|
425
|
+
(a: any): (b: any[]) => any[];
|
|
426
|
+
(a: any, b: any[]): any[];
|
|
427
|
+
};
|
|
414
428
|
export declare const qappend: {
|
|
415
429
|
(a: symbol, b: any[]): (a: any) => any[];
|
|
416
430
|
(a: any, b: symbol): (b: any[]) => any[];
|
package/dist/bundle.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=Symbol("Placeholder"),r=r=>{let t=0;for(const n of r)n!==e&&t++;return t},t=(r,t)=>{const n=r.length,s=r.slice(),c=t.length;let o=c,u=0;for(;o&&u<n;u++)s[u]===e&&(s[u]=t[c-o],o--);for(u=n;o;u++,o--)s[u]=t[c-o];return s},n=(e,s,c)=>{const o=e.length-s.length-r(c);if(o<1)return e(...t(s,c));{const r=(...r)=>n(e,t(s,c),r);return r.$args_left=o,r}},s=e=>(...t)=>e.length>r(t)?n(e,[],t):e(...t),c=r=>function(t){return t===e?r:r(t)};function o(r){return function(t,n){const s=t===e,o=arguments.length;if(1===o&&s)throw new Error("Senseless placeholder usage.");return arguments.length>1?s?c((e=>r(e,n))):r(t,n):e=>r(t,e)}}function u(e){return s(e)}const a=void 0,i=1/0,l=e=>typeof e,f=e=>null===e,h=e=>"number"==l(e),b=e=>Array.isArray(e),g=e=>"function"===l(e),p={u:"U",b:"B",n:"N",s:"S",f:"F"},y=e=>e.toLowerCase(),d=e=>e.toUpperCase(),j=e=>{const r=l(e);return"object"===r?f(e)?"Null":e.constructor.name:p[r[0]]+r.slice(1)},m=o(((e,r)=>j(r)===e)),w=o(((e,r)=>(r.push(e),r))),O=u(((e,r,t)=>(t[e]=r,t))),A=u(((e,r,t)=>t.reduce(e,r))),S=u(((e,r,t)=>{for(let n in t)switch(j(t[n])){case"Array":if(e>1&&"Array"===j(r[n]))switch(e){case 2:const s=r[n],c=t[n];for(const r in c)s[r]?S(e,s[r],c[r]):s[r]=c[r];break;case 3:r[n].push(...t[n])}else r[n]=t[n];break;case"Object":if("Object"===j(r[n])){S(e,r[n],t[n]);break}default:r[n]=t[n]}return r})),k=S(1),v=S(2),N=S(3),x=o(((e,r)=>{let t,n,s,c;for(t in e)n=e[t],[s,c]=g(n)?n(r):[n,r[t]],r[s]=c,t!==s&&delete r[t];return r})),C=o(((e,r)=>{const t=b(r);for(let n in r)e(r[n],n)||(t?r.splice(n,1):delete r[n]);return r})),P=o(((e,r)=>r.indexOf(e))),$=e=>(...r)=>A(((e,r)=>e?e(r):e),e,r),B=e=>(...r)=>r[e],E=o(((e,r)=>{const t=j(e);if(t===j(r)&&("Object"===t||"Array"==t)){if(f(e)||f(r))return e===r;if(e===r)return!0;for(const t of[e,r])for(const n in t)if(!(t===r&&n in e||t===e&&n in r&&E(e[n],r[n])))return!1;return!0}return e===r})),U=s(((e,r,t,n)=>e(n)?r(n):t(n))),_=u(((e,r,t)=>U(e,r,W,t))),F=(...r)=>(...t)=>{let n,s=!0;for(let c=T(r)-1;c>-1;c--)s?(s=!1,n=r[c](...t)):n=n===e?r[c]():r[c](n);return n},I=o(((e,r)=>e.bind(r))),L=o(((e,r)=>r[e])),q=o(((e,r)=>{if((e=>"string"===l(e))(r))return r.includes(e);for(const t of r)if(E(t,e))return!0;return!1})),z=u(((e,r,t)=>t.slice(e,h(r)?r:i))),D=e=>o(((r,t)=>e(t,r))),G=L(0),H=z(1,i),J=o(((e,r)=>e+r)),K=o(((e,r)=>r-e)),M=o(((e,r)=>e*r)),Q=o(((e,r)=>e/r)),R=e=>f(e)||(e=>e===a)(e),T=e=>e.length,V=e=>()=>e,W=e=>e,X=e=>e.trim(),Y=e=>e[T(e)-1],Z=e=>!e,ee=e=>(...r)=>{const t=e(...r)
|
|
1
|
+
const e=Symbol("Placeholder"),r=r=>{let t=0;for(const n of r)n!==e&&t++;return t},t=(r,t)=>{const n=r.length,s=r.slice(),c=t.length;let o=c,u=0;for(;o&&u<n;u++)s[u]===e&&(s[u]=t[c-o],o--);for(u=n;o;u++,o--)s[u]=t[c-o];return s},n=(e,s,c)=>{const o=e.length-s.length-r(c);if(o<1)return e(...t(s,c));{const r=(...r)=>n(e,t(s,c),r);return r.$args_left=o,r}},s=e=>(...t)=>e.length>r(t)?n(e,[],t):e(...t),c=r=>function(t){return t===e?r:r(t)};function o(r){return function(t,n){const s=t===e,o=arguments.length;if(1===o&&s)throw new Error("Senseless placeholder usage.");return arguments.length>1?s?c((e=>r(e,n))):r(t,n):e=>r(t,e)}}function u(e){return s(e)}const a=void 0,i=1/0,l=e=>typeof e,f=e=>null===e,h=e=>"number"==l(e),b=e=>Array.isArray(e),g=e=>"function"===l(e),p={u:"U",b:"B",n:"N",s:"S",f:"F"},y=e=>e.toLowerCase(),d=e=>e.toUpperCase(),j=e=>{const r=l(e);return"object"===r?f(e)?"Null":e.constructor.name:p[r[0]]+r.slice(1)},m=o(((e,r)=>j(r)===e)),w=o(((e,r)=>(r.push(e),r))),O=u(((e,r,t)=>(t[e]=r,t))),A=u(((e,r,t)=>t.reduce(e,r))),S=u(((e,r,t)=>{for(let n in t)switch(j(t[n])){case"Array":if(e>1&&"Array"===j(r[n]))switch(e){case 2:const s=r[n],c=t[n];for(const r in c)s[r]?S(e,s[r],c[r]):s[r]=c[r];break;case 3:r[n].push(...t[n])}else r[n]=t[n];break;case"Object":if("Object"===j(r[n])){S(e,r[n],t[n]);break}default:r[n]=t[n]}return r})),k=S(1),v=S(2),N=S(3),x=o(((e,r)=>{let t,n,s,c;for(t in e)n=e[t],[s,c]=g(n)?n(r):[n,r[t]],r[s]=c,t!==s&&delete r[t];return r})),C=o(((e,r)=>{const t=b(r);for(let n in r)e(r[n],n)||(t?r.splice(n,1):delete r[n]);return r})),P=o(((e,r)=>r.indexOf(e))),$=e=>(...r)=>A(((e,r)=>e?e(r):e),e,r),B=e=>(...r)=>r[e],E=o(((e,r)=>{const t=j(e);if(t===j(r)&&("Object"===t||"Array"==t)){if(f(e)||f(r))return e===r;if(e===r)return!0;for(const t of[e,r])for(const n in t)if(!(t===r&&n in e||t===e&&n in r&&E(e[n],r[n])))return!1;return!0}return e===r})),U=s(((e,r,t,n)=>e(n)?r(n):t(n))),_=u(((e,r,t)=>U(e,r,W,t))),F=(...r)=>(...t)=>{let n,s=!0;for(let c=T(r)-1;c>-1;c--)s?(s=!1,n=r[c](...t)):n=n===e?r[c]():r[c](n);return n},I=o(((e,r)=>e.bind(r))),L=o(((e,r)=>r[e])),q=o(((e,r)=>{if((e=>"string"===l(e))(r))return r.includes(e);for(const t of r)if(E(t,e))return!0;return!1})),z=u(((e,r,t)=>t.slice(e,h(r)?r:i))),D=e=>o(((r,t)=>e(t,r))),G=L(0),H=z(1,i),J=o(((e,r)=>e+r)),K=o(((e,r)=>r-e)),M=o(((e,r)=>e*r)),Q=o(((e,r)=>e/r)),R=e=>f(e)||(e=>e===a)(e),T=e=>e.length,V=e=>()=>e,W=e=>e,X=e=>e.trim(),Y=e=>e[T(e)-1],Z=e=>!e,ee=e=>(...r)=>{const t=e(...r),n=g(t);return!n||n&&t.$args_left<=0?Z(t):ee(t)},re=e=>Object.keys(e),te=e=>Object.values(e),ne=e=>Object.entries(e),se=o(((e,r)=>e.test(r))),ce=o(((e,r)=>(e(r),r))),oe=o(((e,r)=>[...r,e])),ue=o(((e,r)=>r.split(e))),ae=V(!0),ie=V(!1),le=o(((e,r)=>r(...e))),fe=(...e)=>{},he=e=>{if("Object"===j(e)){let r=0;for(let t in e)r++;return r}return T(e)},be=o(((e,r)=>ye(J(e),r-e))),ge=e=>A(((e,r)=>q(r,e)?e:w(r,e)),[],e),pe=o(((e,r)=>e.filter(D(q)(r)))),ye=o(((e,r)=>[...Array(r)].map(((r,t)=>e(t))))),de=e=>{let r,t=!1;return(...n)=>t?r:(t=!0,r=e(...n))},je=e=>F((r=>Me(((t,n,s)=>w(e[r-s],t)),[],e)),J(-1),T)(e),me=o(((e,r)=>e>r)),we=o(((e,r)=>e<r)),Oe=o(((e,r)=>r>=e)),Ae=o(((e,r)=>r<=e)),Se=o(((e,r)=>r.sort(e))),ke=o(((e,r)=>r.find(e))),ve=o(((e,r)=>r.findIndex(e))),Ne=o(((e,r)=>ve(E(e),r))),xe=(e,r="log")=>ce((t=>console[r](e,t))),Ce=o(((e,r)=>{for(const[t,n]of e)if(t(r))return n(r)})),Pe=u(((e,r,t)=>({...t,[e]:r}))),$e=u(((e,r,t)=>F((n=>{return Pe(n,T(e)<2?r:$e(z(1,i,e),r,(s=t[n],f(s)||"object"!==l(s)?{}:t[n])),t);var s}),G)(e))),Be=o(((e,r)=>r.every(e))),Ee=o(((e,r)=>r.some(e))),Ue=o(((e,r)=>e.every((e=>e(r))))),_e=o(((e,r)=>e.some((e=>e(r))))),Fe=o(((e,r)=>r[e])),Ie=u(((e,r,t)=>E(t[e],r))),Le=u(((e,r,t)=>E(r[e],t[e]))),qe=u(((e,r,t)=>U(T,(()=>R(t)?e:F(U(R,V(e),(t=>qe(e,z(1,i,r),t))),D(Fe)(t),G)(r)),V(t),r))),ze=qe(a),De=u(((e,r,t)=>E(ze(e,t),r))),Ge=u(((e,r,t)=>E(ze(e,r),ze(e,t)))),He=/^(.*?)(8|16|32|64)(Clamped)?Array$/,Je=(e,r=!1)=>{const t=j(e);switch(t){case"Null":case"String":case"Number":case"Boolean":case"Symbol":return e;case"Array":return r?[...e]:Ye(F(Je,B(0)),e);case"Object":if(r)return{...e};const n={};for(let r in e)n[r]=Je(e[r]);return n;default:return He.test(t)?e.constructor.from(e):e}},Ke=e=>Je(e,!0),Me=u(((e,r,t)=>A(e,Je(r),t))),Qe=o(((e,r)=>sr(e,r))),Re=o(((e,r)=>{const t={};for(const n of e)n in r&&(t[n]=r[n]);return t})),Te=o(((e,r)=>sr(((r,t)=>!q(t,e)),r))),Ve=e=>Me(((e,r)=>Pe(...r,e)),{},e),We=o(((e,r)=>r.concat(e))),Xe=o(((e,r)=>r.join(e))),Ye=o(((e,r)=>r.map(e))),Ze=o(((e,r)=>r.forEach(e))),er=u(((e,r,t)=>r(t)&&e(t))),rr=e=>{switch(j(e)){case"String":case"Array":return 0==T(e);case"Object":for(const r in e)return!1;return!0;default:return null}},tr=e=>{switch(j(e)){case"String":return"";case"Object":return{};case"Array":return[];default:return a}},nr=u(((e,r,t)=>t.replace(e,r))),sr=o(((e,r)=>b(r)?r.filter(e):F(Ve,sr((([r,t])=>e(t,r))),ne)(r))),cr=e=>{let r,t=!1;return()=>t?r:(t=!0,r=e())},or=o(((e,r)=>Object.assign({},e,r))),ur=o(((e,r)=>k(Je(e),Je(r)))),ar=o(((e,r)=>v(Je(e),Je(r)))),ir=o(((e,r)=>N(Je(e),Je(r)))),lr=u(((e,r,t)=>Pe(e,r(t[e]),t))),fr=o(((e,r)=>x(e,Object.assign({},r)))),hr=o(((e,r)=>Ye(((e,t)=>[e,r[t]]),e))),br=o(((e,r)=>Me(((e,t,n)=>Pe(t,r[n],e)),{},e))),gr=u(((e,r,t)=>Ye(((r,n)=>e(r,t[n])),r))),pr=(()=>{const e=async(r,t,n)=>{n<t.length&&(await r(t[n]),await e(r,t,++n))};return o(((r,t)=>e(r,t,0)))})(),yr=e=>Promise.all(e),dr=o((async(e,r)=>(await e(r),r))),jr=o(((e,r)=>Promise.all(r.map(e)))),mr=(()=>{const e=async(r,t,n)=>~n?await e(r,await r[n](t),--n):t;return(...r)=>t=>e(r,t,r.length-1)})(),wr=W,Or=W,Ar=W,Sr=ee,kr=oe,vr=e=>{const r=[],t=[],n=e.length;let s,c,o,u=0,a=0,i=!1,l=G(e),f=!1;for(u=0;u<n;u++)switch(s=e[u],s){case"{":if(!l){i=!0,a=u;break}case"}":if(!l){i=!1,r.push(""),t.push(e.slice(a+1,u));break}default:o=e[u+1],f="\\"===s,i||f&&("{"===o||"}"===o)||(c=r.length-1,c<0&&(r.push(""),c++),r[c]+=s),l=f}return e=>{const n=[],s=r.length-1;for(const c in r)u=+c,n.push(r[u]),u!==s&&n.push(ze(t[u].split("."),e));return n.join("")}};export{ie as F,ae as T,e as __,J as add,Be as all,Ue as allPass,V as always,Ee as any,_e as anyPass,oe as append,Pe as assoc,$e as assocPath,I as bind,er as both,le as callWith,Je as clone,Ke as cloneShallow,ee as complement,F as compose,mr as composeAsync,We as concat,Ce as cond,s as curry,o as curry2,u as curry3,Q as divide,Ar as echo,tr as empty,E as equals,xe as explore,sr as filter,ke as find,ve as findIndex,D as flip,Ze as forEach,jr as forEachAsync,pr as forEachSerial,Ve as fromPairs,ye as genBy,vr as getTmpl,me as gt,Oe as gte,G as head,W as identity,U as ifElse,q as includes,Ne as indexOf,pe as intersection,rr as isEmpty,R as isNil,Xe as join,re as keys,Y as last,T as length,we as lt,Ae as lte,Ye as map,fr as mapKeys,cr as memoize,ur as mergeDeep,ir as mergeDeepAdd,ar as mergeDeepX,or as mergeShallow,wr as mirror,M as multiply,fe as noop,Z as not,Sr as notf,L as nth,Te as omit,de as once,lr as overProp,ze as path,De as pathEq,qe as pathOr,Ge as pathsEq,Re as pick,Qe as pickBy,Fe as prop,Ie as propEq,Le as propsEq,kr as push,w as qappend,O as qassoc,C as qfilter,P as qindexOf,x as qmapKeys,k as qmergeDeep,N as qmergeDeepAdd,v as qmergeDeepX,A as qreduce,be as range,Me as reduce,Or as reflect,nr as replace,je as reverse,he as sizeof,z as slice,Se as sort,ue as split,K as subtract,H as tail,B as take,ce as tap,se as test,y as toLower,ne as toPairs,d as toUpper,X as trim,j as type,m as typeIs,$ as uncurry,ge as uniq,te as values,yr as waitAll,dr as waitTap,_ as when,hr as zip,br as zipObj,gr as zipWith};
|
package/package.json
CHANGED
package/src/quick.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type } from "./common"
|
|
|
3
3
|
import { AnyObject, Reducer, AnyFunc } from "./types"
|
|
4
4
|
import { isFunc, isArray } from "./utils"
|
|
5
5
|
|
|
6
|
-
// TODO: qmap, qfilter
|
|
6
|
+
// TODO: qmap, qfilter, qoverProp, qover array ?
|
|
7
7
|
|
|
8
8
|
export const qappend = curry2((s: any, xs: any[]) => {xs.push(s); return xs})
|
|
9
9
|
export const qassoc = curry3(
|
package/src/safe.ts
CHANGED
|
@@ -70,14 +70,9 @@ export const nth = curry2(_nth)
|
|
|
70
70
|
|
|
71
71
|
export const includes = curry2(
|
|
72
72
|
<T>(s: T, ss: T[]) => {
|
|
73
|
-
if(isStr(ss))
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
for(const a of ss) {
|
|
77
|
-
if(equals(a, s)) {
|
|
78
|
-
return true
|
|
79
|
-
}
|
|
80
|
-
}
|
|
73
|
+
if(isStr(ss)) return ss.includes(s)
|
|
74
|
+
else {
|
|
75
|
+
for(const a of ss) if(equals(a, s)) return true
|
|
81
76
|
return false
|
|
82
77
|
}
|
|
83
78
|
}
|
|
@@ -90,7 +85,7 @@ export const flip =
|
|
|
90
85
|
<T extends AnyFunc>(fn: T) => curry2(
|
|
91
86
|
(b: Parameters<T>[1], a: Parameters<T>[0]) => fn(a, b)
|
|
92
87
|
)
|
|
93
|
-
export const head = nth(0)
|
|
88
|
+
export const head = nth(0) as <T = any>(xs: T[] | string) => T
|
|
94
89
|
export const tail = slice(1, inf) // typeshit.
|
|
95
90
|
export const add = curry2((n: number, m: number) => n+m)
|
|
96
91
|
export const subtract = curry2((n: number, m: number) => m-n)
|
|
@@ -105,7 +100,8 @@ export const last = (s: any[] | string) => s[length(s)-1]
|
|
|
105
100
|
export const not = (o: boolean) => !o
|
|
106
101
|
export const complement = (fn: AnyFunc) => (...args: any) => {
|
|
107
102
|
const out = fn(...args)
|
|
108
|
-
|
|
103
|
+
const f = isFunc(out)
|
|
104
|
+
return !f || f&&out.$args_left<=0 ? not(out) : complement(out)
|
|
109
105
|
}
|
|
110
106
|
export const keys = (o: AnyObject | any[]) => Object.keys(o)
|
|
111
107
|
export const values = (o: AnyObject | any[]) => Object.values(o)
|
|
@@ -116,6 +112,8 @@ export const append = curry2((s: any, xs: any[]) => [...xs, s])
|
|
|
116
112
|
export const split = curry2((s: string|RegExp, xs: string) => xs.split(s))
|
|
117
113
|
export const T = always<true>(true) as (...args: any[]) => true
|
|
118
114
|
export const F = always<false>(false) as (...args: any[]) => false
|
|
115
|
+
export const callWith = curry2((args: any[], fn: AnyFunc) => fn(...args))
|
|
116
|
+
export const noop = (..._args: any[]) => {}
|
|
119
117
|
export const sizeof = (s: any[] | string | AnyObject) => {
|
|
120
118
|
if(type(s) === 'Object') {
|
|
121
119
|
let len = 0
|
|
@@ -298,7 +296,7 @@ export const fromPairs = (pairs: [string, any][]) => reduce(
|
|
|
298
296
|
type Concat = ((a: string, b: string) => string)
|
|
299
297
|
| ((a: any[], b: any[]) => any[])
|
|
300
298
|
export const concat = curry2(
|
|
301
|
-
((a, b) =>
|
|
299
|
+
((a, b) => b.concat(a)) as Concat
|
|
302
300
|
)
|
|
303
301
|
export const join = curry2(
|
|
304
302
|
(delimeter: string, arr: string[]) => arr.join(delimeter)
|
|
@@ -430,4 +428,6 @@ export const composeAsync = (() => {
|
|
|
430
428
|
// ALIASES
|
|
431
429
|
export const mirror = identity
|
|
432
430
|
export const reflect = identity
|
|
433
|
-
export const echo = identity
|
|
431
|
+
export const echo = identity
|
|
432
|
+
export const notf = complement
|
|
433
|
+
export const push = append
|
package/dist/bundle.dev.js
DELETED
|
@@ -1,625 +0,0 @@
|
|
|
1
|
-
const __ = Symbol('Placeholder');
|
|
2
|
-
const countArgs = (s) => {
|
|
3
|
-
let i = 0;
|
|
4
|
-
for (const v of s)
|
|
5
|
-
v !== __ && i++;
|
|
6
|
-
return i;
|
|
7
|
-
};
|
|
8
|
-
// TODO: try to make it mutable.
|
|
9
|
-
// { 0: __, 1: 10 }, [ 11 ]
|
|
10
|
-
const addArgs = (args, _args) => {
|
|
11
|
-
const len = args.length;
|
|
12
|
-
const new_args = args.slice();
|
|
13
|
-
const _args_len = _args.length;
|
|
14
|
-
let _args_left = _args_len;
|
|
15
|
-
let i = 0;
|
|
16
|
-
for (; _args_left && i < len; i++) {
|
|
17
|
-
if (new_args[i] === __) {
|
|
18
|
-
new_args[i] = _args[_args_len - _args_left];
|
|
19
|
-
_args_left--;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
for (i = len; _args_left; i++, _args_left--) {
|
|
23
|
-
new_args[i] = _args[_args_len - _args_left];
|
|
24
|
-
}
|
|
25
|
-
return new_args;
|
|
26
|
-
};
|
|
27
|
-
const _curry = (fn, args, new_args) => {
|
|
28
|
-
const args2add = fn.length - args.length - countArgs(new_args);
|
|
29
|
-
if (args2add < 1) {
|
|
30
|
-
return fn(...addArgs(args, new_args));
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
const curried = (...__args) => _curry(fn, addArgs(args, new_args), __args);
|
|
34
|
-
curried.$args_left = args2add;
|
|
35
|
-
return curried;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const curry = (fn) => ((...args) => fn.length > countArgs(args)
|
|
39
|
-
? _curry(fn, [], args)
|
|
40
|
-
: fn(...args));
|
|
41
|
-
const endlessph = (fn) => {
|
|
42
|
-
function _endlessph(a) {
|
|
43
|
-
return a === __ ? fn : fn(a);
|
|
44
|
-
}
|
|
45
|
-
return _endlessph;
|
|
46
|
-
};
|
|
47
|
-
function curry2(fn) {
|
|
48
|
-
function curried2(a, b) {
|
|
49
|
-
const withPlaceholder1 = a === __;
|
|
50
|
-
const aln = arguments.length;
|
|
51
|
-
if (aln === 1 && withPlaceholder1)
|
|
52
|
-
throw new Error('Senseless placeholder usage.');
|
|
53
|
-
return arguments.length > 1
|
|
54
|
-
? withPlaceholder1
|
|
55
|
-
? endlessph((a) => fn(a, b))
|
|
56
|
-
: fn(a, b)
|
|
57
|
-
: (b) => fn(a, b);
|
|
58
|
-
}
|
|
59
|
-
return curried2;
|
|
60
|
-
}
|
|
61
|
-
function curry3(fn) {
|
|
62
|
-
// type p0 = Parameters<Func>[0]
|
|
63
|
-
// type p1 = Parameters<Func>[1]
|
|
64
|
-
// type p2 = Parameters<Func>[2]
|
|
65
|
-
// type ReturnT = ReturnType<Func>
|
|
66
|
-
// TODO: optimize.
|
|
67
|
-
// Cannot use ts-toolbelt due to this error:
|
|
68
|
-
// Excessive stack depth comparing types 'GapsOf<?, L2>' and 'GapsOf<?, L2>'
|
|
69
|
-
return curry(fn);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const undef = undefined;
|
|
73
|
-
const nul = null;
|
|
74
|
-
const inf = Infinity;
|
|
75
|
-
const to = (s) => typeof s;
|
|
76
|
-
const isNull = (s) => s === nul;
|
|
77
|
-
const isUndef = (s) => s === undef;
|
|
78
|
-
const isNum = (s) => to(s) == 'number';
|
|
79
|
-
const isArray = (s) => Array.isArray(s);
|
|
80
|
-
const isFunc = (s) => to(s) === 'function';
|
|
81
|
-
const isStr = (s) => to(s) === 'string';
|
|
82
|
-
const isObj = (s) => !isNull(s) && to(s) === 'object';
|
|
83
|
-
|
|
84
|
-
// It's faster that toUpperCase() !
|
|
85
|
-
const caseMap = {
|
|
86
|
-
u: 'U', b: 'B', n: 'N', s: 'S', f: 'F'
|
|
87
|
-
};
|
|
88
|
-
const toLower = (s) => s.toLowerCase();
|
|
89
|
-
const toUpper = (s) => s.toUpperCase();
|
|
90
|
-
const type = (s) => {
|
|
91
|
-
const t = to(s);
|
|
92
|
-
return t === 'object'
|
|
93
|
-
? isNull(s) ? 'Null' : s.constructor.name
|
|
94
|
-
: caseMap[t[0]] + t.slice(1);
|
|
95
|
-
};
|
|
96
|
-
const typeIs = curry2((t, s) => type(s) === t);
|
|
97
|
-
|
|
98
|
-
// TODO: qmap, qfilter.
|
|
99
|
-
const qappend = curry2((s, xs) => { xs.push(s); return xs; });
|
|
100
|
-
const qassoc = curry3((prop, v, obj) => {
|
|
101
|
-
obj[prop] = v;
|
|
102
|
-
return obj;
|
|
103
|
-
});
|
|
104
|
-
const qreduce = curry3((fn, accum, arr) => arr.reduce(fn, accum));
|
|
105
|
-
// strategy is for arrays: 1->clean, 2->merge, 3->push.
|
|
106
|
-
const mergeDeep$1 = curry3((strategy, o1, o2) => {
|
|
107
|
-
for (let k in o2) {
|
|
108
|
-
switch (type(o2[k])) {
|
|
109
|
-
case 'Array':
|
|
110
|
-
if (strategy > 1 && type(o1[k]) === 'Array') {
|
|
111
|
-
switch (strategy) {
|
|
112
|
-
case 2:
|
|
113
|
-
const o1k = o1[k], o2k = o2[k];
|
|
114
|
-
for (const i in o2k) {
|
|
115
|
-
if (o1k[i]) {
|
|
116
|
-
mergeDeep$1(strategy, o1k[i], o2k[i]);
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
o1k[i] = o2k[i];
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
break;
|
|
123
|
-
case 3: o1[k].push(...o2[k]);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
o1[k] = o2[k];
|
|
128
|
-
}
|
|
129
|
-
break;
|
|
130
|
-
case 'Object':
|
|
131
|
-
if (type(o1[k]) === 'Object') {
|
|
132
|
-
mergeDeep$1(strategy, o1[k], o2[k]);
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
default:
|
|
136
|
-
o1[k] = o2[k];
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return o1;
|
|
141
|
-
});
|
|
142
|
-
const qmergeDeep = mergeDeep$1(1);
|
|
143
|
-
const qmergeDeepX = mergeDeep$1(2);
|
|
144
|
-
const qmergeDeepAdd = mergeDeep$1(3);
|
|
145
|
-
/** qmapKeys({ a: 'b' }, { a: 44 }) -> { b: 44 } */
|
|
146
|
-
const qmapKeys = curry2((keyMap, o) => {
|
|
147
|
-
let k, mapped, newKey, newValue;
|
|
148
|
-
for (k in keyMap) {
|
|
149
|
-
mapped = keyMap[k];
|
|
150
|
-
[newKey, newValue] = isFunc(mapped)
|
|
151
|
-
? mapped(o)
|
|
152
|
-
: [mapped, o[k]];
|
|
153
|
-
o[newKey] = newValue;
|
|
154
|
-
if (k !== newKey) {
|
|
155
|
-
delete o[k];
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return o;
|
|
159
|
-
});
|
|
160
|
-
const qfilter = curry2((cond, data) => {
|
|
161
|
-
const isArr = isArray(data);
|
|
162
|
-
for (let k in data) {
|
|
163
|
-
if (!cond(data[k], k)) {
|
|
164
|
-
if (isArr) {
|
|
165
|
-
data.splice(k, 1);
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
// TODO: handle Maps and Sets ?
|
|
169
|
-
delete data[k];
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return data;
|
|
174
|
-
});
|
|
175
|
-
/** @deprecated */
|
|
176
|
-
const qindexOf = curry2((x, xs) => xs.indexOf(x));
|
|
177
|
-
|
|
178
|
-
// TODO: possibly introduce a second argument limiting unfolding.
|
|
179
|
-
const uncurry = (fn) => (...args) => qreduce(((fn, arg) => fn ? fn(arg) : fn), fn, args);
|
|
180
|
-
|
|
181
|
-
// over, lensProp
|
|
182
|
-
const take = (argN) => (...args) => args[argN];
|
|
183
|
-
const equals = curry2((a, b) => {
|
|
184
|
-
const typea = type(a);
|
|
185
|
-
if (typea === type(b) && (typea === 'Object' || typea == 'Array')) {
|
|
186
|
-
if (isNull(a) || isNull(b)) {
|
|
187
|
-
return a === b;
|
|
188
|
-
}
|
|
189
|
-
if (a === b) {
|
|
190
|
-
return true;
|
|
191
|
-
}
|
|
192
|
-
for (const v of [a, b]) {
|
|
193
|
-
for (const k in v) {
|
|
194
|
-
if (!((v === b) && (k in a)) &&
|
|
195
|
-
!((v === a) && (k in b) && equals(a[k], b[k]))) {
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return true;
|
|
201
|
-
}
|
|
202
|
-
return a === b;
|
|
203
|
-
});
|
|
204
|
-
const ifElse = curry((cond, pipeYes, pipeNo, s) => cond(s) ? pipeYes(s) : pipeNo(s));
|
|
205
|
-
const when = curry3((cond, pipe, s) => ifElse(cond, pipe, identity, s));
|
|
206
|
-
const compose = ((...fns) => (...args) => {
|
|
207
|
-
let first = true;
|
|
208
|
-
let s;
|
|
209
|
-
for (let i = length(fns) - 1; i > -1; i--) {
|
|
210
|
-
if (first) {
|
|
211
|
-
first = false;
|
|
212
|
-
s = fns[i](...args);
|
|
213
|
-
}
|
|
214
|
-
else
|
|
215
|
-
s = s === __ ? fns[i]() : fns[i](s);
|
|
216
|
-
}
|
|
217
|
-
return s;
|
|
218
|
-
});
|
|
219
|
-
const bind = curry2((fn, context) => fn.bind(context));
|
|
220
|
-
const _nth = (i, data) => data[i];
|
|
221
|
-
const nth = curry2(_nth);
|
|
222
|
-
const includes = curry2((s, ss) => {
|
|
223
|
-
if (isStr(ss)) {
|
|
224
|
-
return ss.includes(s);
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
for (const a of ss) {
|
|
228
|
-
if (equals(a, s)) {
|
|
229
|
-
return true;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return false;
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
const slice = curry3((from, to, o) => o.slice(from, (isNum(to) ? to : inf)));
|
|
236
|
-
const flip = (fn) => curry2((b, a) => fn(a, b));
|
|
237
|
-
const head = nth(0);
|
|
238
|
-
const tail = slice(1, inf); // typeshit.
|
|
239
|
-
const add = curry2((n, m) => n + m);
|
|
240
|
-
const subtract = curry2((n, m) => m - n);
|
|
241
|
-
const multiply = curry2((n, m) => n * m);
|
|
242
|
-
const divide = curry2((n, m) => n / m);
|
|
243
|
-
const isNil = (s) => isNull(s) || isUndef(s);
|
|
244
|
-
const length = (s) => s.length;
|
|
245
|
-
const always = (s) => () => s;
|
|
246
|
-
const identity = (s) => s;
|
|
247
|
-
const trim = (s) => s.trim();
|
|
248
|
-
const last = (s) => s[length(s) - 1];
|
|
249
|
-
const not = (o) => !o;
|
|
250
|
-
const complement = (fn) => (...args) => {
|
|
251
|
-
const out = fn(...args);
|
|
252
|
-
return (isFunc(out) && out.$args_left) ? complement(out) : not(out);
|
|
253
|
-
};
|
|
254
|
-
const keys = (o) => Object.keys(o);
|
|
255
|
-
const values = (o) => Object.values(o);
|
|
256
|
-
const toPairs = (o) => Object.entries(o);
|
|
257
|
-
const test = curry2((re, s) => re.test(s));
|
|
258
|
-
const tap = curry2((fn, s) => { fn(s); return s; });
|
|
259
|
-
const append = curry2((s, xs) => [...xs, s]);
|
|
260
|
-
const split = curry2((s, xs) => xs.split(s));
|
|
261
|
-
const T = always(true);
|
|
262
|
-
const F = always(false);
|
|
263
|
-
const sizeof = (s) => {
|
|
264
|
-
if (type(s) === 'Object') {
|
|
265
|
-
let len = 0;
|
|
266
|
-
for (let _k in s)
|
|
267
|
-
len++;
|
|
268
|
-
return len;
|
|
269
|
-
}
|
|
270
|
-
else
|
|
271
|
-
return length(s);
|
|
272
|
-
};
|
|
273
|
-
const range = curry2((from, to) => genBy(add(from), to - from));
|
|
274
|
-
const uniq = (xs) => qreduce((accum, x) => includes(x, accum) ? accum : qappend(x, accum), [], xs);
|
|
275
|
-
const intersection = curry2((xs1, xs2) => xs1.filter(flip(includes)(xs2)));
|
|
276
|
-
const genBy = curry2((generator, length) => [...Array(length)].map((_, i) => generator(i)));
|
|
277
|
-
const once = (fn) => {
|
|
278
|
-
let done = false, cache;
|
|
279
|
-
return (...args) => {
|
|
280
|
-
if (done) {
|
|
281
|
-
return cache;
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
done = true;
|
|
285
|
-
return cache = fn(...args);
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
};
|
|
289
|
-
const reverse = (xs) => compose((ln) => reduce((nxs, _, i) => qappend(xs[ln - i], nxs), [], xs), add(-1), length)(xs);
|
|
290
|
-
const gt = curry2((a, b) => a > b);
|
|
291
|
-
const lt = curry2((a, b) => a < b);
|
|
292
|
-
const gte = curry2((a, b) => b >= a);
|
|
293
|
-
const lte = curry2((a, b) => b <= a);
|
|
294
|
-
const sort = curry2((sortFn, xs) => xs.sort(sortFn));
|
|
295
|
-
const find = curry2((fn, s) => s.find(fn));
|
|
296
|
-
const findIndex = curry2((fn, s) => s.findIndex(fn));
|
|
297
|
-
const indexOf = curry2((x, xs) => findIndex(equals(x), xs));
|
|
298
|
-
const explore = (caption, level = 'log') => tap((v) => console[level](caption, v));
|
|
299
|
-
const cond = curry2((pairs, s) => {
|
|
300
|
-
for (const [cond, fn] of pairs) {
|
|
301
|
-
if (cond(s)) {
|
|
302
|
-
return fn(s);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
/** Assigns a prop to an object.
|
|
307
|
-
* @param prop string
|
|
308
|
-
* @param value any
|
|
309
|
-
* @param object AnyObject
|
|
310
|
-
*/
|
|
311
|
-
const assoc = curry3((prop, v, obj) => ({
|
|
312
|
-
...obj,
|
|
313
|
-
[prop]: v
|
|
314
|
-
}));
|
|
315
|
-
const assocPath = curry3((_path, v, o) => compose((first) => assoc(first, length(_path) < 2
|
|
316
|
-
? v
|
|
317
|
-
: assocPath(slice(1, inf, _path), v, isObj(o[first]) ? o[first] : {}), o), head)(_path));
|
|
318
|
-
const all = curry2((pred, xs) => xs.every(pred));
|
|
319
|
-
const any = curry2((pred, xs) => xs.some(pred));
|
|
320
|
-
const allPass = curry2((preds, x) => preds.every((pred) => pred(x)));
|
|
321
|
-
const anyPass = curry2((preds, x) => preds.some((pred) => pred(x)));
|
|
322
|
-
const prop = curry2((key, o) => o[key]);
|
|
323
|
-
const propEq = curry3((key, value, o) => equals(o[key], value));
|
|
324
|
-
const propsEq = curry3((key, o1, o2) => equals(o1[key], o2[key]));
|
|
325
|
-
const pathOr = curry3((_default, path, o) => ifElse(length, () => isNil(o)
|
|
326
|
-
? _default
|
|
327
|
-
: compose(ifElse(isNil, always(_default), (o) => pathOr(_default, slice(1, inf, path), o)), flip(prop)(o), head)(path), always(o), path));
|
|
328
|
-
const path = pathOr(undef);
|
|
329
|
-
const pathEq = curry3((_path, value, o) => equals(path(_path, o), value));
|
|
330
|
-
const pathsEq = curry3((_path, o1, o2) => equals(path(_path, o1), path(_path, o2)));
|
|
331
|
-
const typed_arr_re = /^(.*?)(8|16|32|64)(Clamped)?Array$/;
|
|
332
|
-
const clone = (s, shallow = false) => {
|
|
333
|
-
const t = type(s);
|
|
334
|
-
switch (t) {
|
|
335
|
-
case 'Null': return s;
|
|
336
|
-
case 'Array': return shallow ? [...s] : map(compose(clone, take(0)), s);
|
|
337
|
-
case 'Object':
|
|
338
|
-
if (shallow)
|
|
339
|
-
return { ...s };
|
|
340
|
-
const out = {};
|
|
341
|
-
for (let k in s) {
|
|
342
|
-
out[k] = clone(s[k]);
|
|
343
|
-
}
|
|
344
|
-
return out;
|
|
345
|
-
case 'String':
|
|
346
|
-
case 'Number':
|
|
347
|
-
case 'Boolean':
|
|
348
|
-
case 'Symbol':
|
|
349
|
-
return s;
|
|
350
|
-
default:
|
|
351
|
-
return typed_arr_re.test(t) ? s.constructor.from(s) : s;
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
const cloneShallow = (s) => clone(s, true);
|
|
355
|
-
/** types T1, T2
|
|
356
|
-
* @param reducer (accum: T1, current: T2, index: number) => newAccum: T1
|
|
357
|
-
* @param accum T1
|
|
358
|
-
* @param array T2[]
|
|
359
|
-
*/
|
|
360
|
-
const reduce = curry3((reducer, accum, arr) => qreduce(reducer, clone(accum), arr));
|
|
361
|
-
const pickBy = curry2((cond, o) => filter(cond, o));
|
|
362
|
-
const pick = curry2((props, o) => {
|
|
363
|
-
const out = {};
|
|
364
|
-
for (const p of props) {
|
|
365
|
-
if (p in o) {
|
|
366
|
-
out[p] = o[p];
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
return out;
|
|
370
|
-
});
|
|
371
|
-
const omit = curry2((props, o) => filter((_, k) => !includes(k, props), o));
|
|
372
|
-
const fromPairs = (pairs) => reduce((o, pair) => assoc(...pair, o), {}, pairs);
|
|
373
|
-
const concat = curry2(((a, b) => a.concat(b)));
|
|
374
|
-
const join = curry2((delimeter, arr) => arr.join(delimeter));
|
|
375
|
-
const map = curry2((pipe, arr) => arr.map(pipe));
|
|
376
|
-
const forEach = curry2((pipe, arr) => arr.forEach(pipe));
|
|
377
|
-
const both = curry3((cond1, cond2, s) => cond2(s) && cond1(s));
|
|
378
|
-
const isEmpty = (s) => {
|
|
379
|
-
switch (type(s)) {
|
|
380
|
-
case 'String':
|
|
381
|
-
case 'Array': return length(s) == 0;
|
|
382
|
-
case 'Object':
|
|
383
|
-
for (const _k in s)
|
|
384
|
-
return false;
|
|
385
|
-
return true;
|
|
386
|
-
default: return null;
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
const empty = (s) => {
|
|
390
|
-
switch (type(s)) {
|
|
391
|
-
case 'String': return '';
|
|
392
|
-
case 'Object': return {};
|
|
393
|
-
case 'Array': return [];
|
|
394
|
-
default: return undef;
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
const replace = curry3((a, b, where
|
|
398
|
-
// @ts-ignore-next Some bug with overload.
|
|
399
|
-
) => where.replace(a, b));
|
|
400
|
-
const filter = curry2((cond, data) => isArray(data)
|
|
401
|
-
? data.filter(cond)
|
|
402
|
-
: compose(fromPairs, filter(([k, v]) => cond(v, k)), toPairs)(data));
|
|
403
|
-
const memoize = (fn) => {
|
|
404
|
-
let cache;
|
|
405
|
-
let cached = false;
|
|
406
|
-
return () => cached ? cache : (cached = true, cache = fn());
|
|
407
|
-
};
|
|
408
|
-
const mergeShallow = curry2((o1, o2) => Object.assign({}, o1, o2));
|
|
409
|
-
const mergeDeep = curry2((a, b) => qmergeDeep(clone(a), clone(b)));
|
|
410
|
-
const mergeDeepX = curry2((a, b) => qmergeDeepX(clone(a), clone(b)));
|
|
411
|
-
const mergeDeepAdd = curry2((a, b) => qmergeDeepAdd(clone(a), clone(b)));
|
|
412
|
-
const overProp = curry3((prop, pipe, data) => assoc(prop, pipe(data[prop]), data));
|
|
413
|
-
/** mapKeys({ a: 'b' }, { a: 44 }) -> { b: 44 } */
|
|
414
|
-
const mapKeys = curry2((keyMap, o) => qmapKeys(keyMap, Object.assign({}, o)));
|
|
415
|
-
const zip = curry2((a, b) => map((s, i) => [s, b[i]], a));
|
|
416
|
-
const zipObj = curry2((a, b) => reduce((ac, s, i) => assoc(s, b[i], ac), {}, a));
|
|
417
|
-
// TODO: Tuple curried functions to replace these `AnyFuncs`.
|
|
418
|
-
/** zips through a pipe. Types T1, T2, T3.
|
|
419
|
-
* @returns T3[]
|
|
420
|
-
* @param pipe (T1, T2) => T3
|
|
421
|
-
* @param a T1[]
|
|
422
|
-
* @param b T2[]
|
|
423
|
-
*/
|
|
424
|
-
const zipWith = curry3((pipe, a, b) => map((s, i) => pipe(s, b[i]), a));
|
|
425
|
-
// ASYNCS
|
|
426
|
-
/** One promise waits for another. */
|
|
427
|
-
const forEachSerial = (() => {
|
|
428
|
-
const pipe = async (fn, items, i) => {
|
|
429
|
-
if (i < items.length) {
|
|
430
|
-
await fn(items[i]);
|
|
431
|
-
await pipe(fn, items, ++i);
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
return curry2((fn, items) => pipe(fn, items, 0));
|
|
435
|
-
})();
|
|
436
|
-
/** Promise.all wrapper for functional pipelining. */
|
|
437
|
-
const waitAll = (promises) => Promise.all(promises);
|
|
438
|
-
const waitTap = curry2(async (fn, s) => { await fn(s); return s; });
|
|
439
|
-
/** Waits for all promises mapped by the fn. */
|
|
440
|
-
const forEachAsync = curry2((fn, items) => Promise.all(items.map(fn)));
|
|
441
|
-
/** The same as compose, but waits for promises in chains and returns a Promise. */
|
|
442
|
-
const composeAsync = (() => {
|
|
443
|
-
const pipe = async (fns, data, i) => ~i ? await pipe(fns, await fns[i](data), --i) : data;
|
|
444
|
-
return (...fns) => (data) => pipe(fns, data, fns.length - 1);
|
|
445
|
-
})(); // as FT.Compose<'async'>
|
|
446
|
-
// ALIASES
|
|
447
|
-
const mirror = identity;
|
|
448
|
-
const reflect = identity;
|
|
449
|
-
const echo = identity;
|
|
450
|
-
|
|
451
|
-
const ecran = '\\';
|
|
452
|
-
// TODO: make it splicy, not accumulatie by symbols.
|
|
453
|
-
// Supports ecrans: '\{"json": {yes} \}'
|
|
454
|
-
// get_tmpl(one{meme}two)({meme: 42}) -> one42two
|
|
455
|
-
const getTmpl = (tmpl) => {
|
|
456
|
-
const parts = [];
|
|
457
|
-
const keymap = [];
|
|
458
|
-
const len = tmpl.length;
|
|
459
|
-
let i = 0, s, ln, start = 0, open = false, hasEcran = head(tmpl), hasEcranNext = false, nextChar;
|
|
460
|
-
for (i = 0; i < len; i++) {
|
|
461
|
-
s = tmpl[i];
|
|
462
|
-
switch (s) {
|
|
463
|
-
case '{':
|
|
464
|
-
if (!hasEcran) {
|
|
465
|
-
open = true;
|
|
466
|
-
start = i;
|
|
467
|
-
break;
|
|
468
|
-
}
|
|
469
|
-
case '}':
|
|
470
|
-
if (!hasEcran) {
|
|
471
|
-
open = false;
|
|
472
|
-
parts.push('');
|
|
473
|
-
keymap.push(tmpl.slice(start + 1, i));
|
|
474
|
-
break;
|
|
475
|
-
}
|
|
476
|
-
default:
|
|
477
|
-
nextChar = tmpl[i + 1];
|
|
478
|
-
hasEcranNext = s === ecran;
|
|
479
|
-
if (!open && (!hasEcranNext || nextChar !== '{' && nextChar !== '}')) {
|
|
480
|
-
ln = parts.length - 1;
|
|
481
|
-
if (ln < 0) {
|
|
482
|
-
parts.push('');
|
|
483
|
-
ln++;
|
|
484
|
-
}
|
|
485
|
-
parts[ln] += s;
|
|
486
|
-
}
|
|
487
|
-
hasEcran = hasEcranNext;
|
|
488
|
-
break;
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
return (data) => {
|
|
492
|
-
const out = [];
|
|
493
|
-
const ln = parts.length - 1;
|
|
494
|
-
for (const j in parts) {
|
|
495
|
-
i = +j;
|
|
496
|
-
out.push(parts[i]);
|
|
497
|
-
if (i !== ln)
|
|
498
|
-
out.push(path(keymap[i].split('.'), data));
|
|
499
|
-
}
|
|
500
|
-
return out.join('');
|
|
501
|
-
};
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
var pepka = /*#__PURE__*/Object.freeze({
|
|
505
|
-
__proto__: null,
|
|
506
|
-
__: __,
|
|
507
|
-
curry: curry,
|
|
508
|
-
curry2: curry2,
|
|
509
|
-
curry3: curry3,
|
|
510
|
-
uncurry: uncurry,
|
|
511
|
-
toLower: toLower,
|
|
512
|
-
toUpper: toUpper,
|
|
513
|
-
type: type,
|
|
514
|
-
typeIs: typeIs,
|
|
515
|
-
take: take,
|
|
516
|
-
equals: equals,
|
|
517
|
-
ifElse: ifElse,
|
|
518
|
-
when: when,
|
|
519
|
-
compose: compose,
|
|
520
|
-
bind: bind,
|
|
521
|
-
nth: nth,
|
|
522
|
-
includes: includes,
|
|
523
|
-
slice: slice,
|
|
524
|
-
flip: flip,
|
|
525
|
-
head: head,
|
|
526
|
-
tail: tail,
|
|
527
|
-
add: add,
|
|
528
|
-
subtract: subtract,
|
|
529
|
-
multiply: multiply,
|
|
530
|
-
divide: divide,
|
|
531
|
-
isNil: isNil,
|
|
532
|
-
length: length,
|
|
533
|
-
always: always,
|
|
534
|
-
identity: identity,
|
|
535
|
-
trim: trim,
|
|
536
|
-
last: last,
|
|
537
|
-
not: not,
|
|
538
|
-
complement: complement,
|
|
539
|
-
keys: keys,
|
|
540
|
-
values: values,
|
|
541
|
-
toPairs: toPairs,
|
|
542
|
-
test: test,
|
|
543
|
-
tap: tap,
|
|
544
|
-
append: append,
|
|
545
|
-
split: split,
|
|
546
|
-
T: T,
|
|
547
|
-
F: F,
|
|
548
|
-
sizeof: sizeof,
|
|
549
|
-
range: range,
|
|
550
|
-
uniq: uniq,
|
|
551
|
-
intersection: intersection,
|
|
552
|
-
genBy: genBy,
|
|
553
|
-
once: once,
|
|
554
|
-
reverse: reverse,
|
|
555
|
-
gt: gt,
|
|
556
|
-
lt: lt,
|
|
557
|
-
gte: gte,
|
|
558
|
-
lte: lte,
|
|
559
|
-
sort: sort,
|
|
560
|
-
find: find,
|
|
561
|
-
findIndex: findIndex,
|
|
562
|
-
indexOf: indexOf,
|
|
563
|
-
explore: explore,
|
|
564
|
-
cond: cond,
|
|
565
|
-
assoc: assoc,
|
|
566
|
-
assocPath: assocPath,
|
|
567
|
-
all: all,
|
|
568
|
-
any: any,
|
|
569
|
-
allPass: allPass,
|
|
570
|
-
anyPass: anyPass,
|
|
571
|
-
prop: prop,
|
|
572
|
-
propEq: propEq,
|
|
573
|
-
propsEq: propsEq,
|
|
574
|
-
pathOr: pathOr,
|
|
575
|
-
path: path,
|
|
576
|
-
pathEq: pathEq,
|
|
577
|
-
pathsEq: pathsEq,
|
|
578
|
-
clone: clone,
|
|
579
|
-
cloneShallow: cloneShallow,
|
|
580
|
-
reduce: reduce,
|
|
581
|
-
pickBy: pickBy,
|
|
582
|
-
pick: pick,
|
|
583
|
-
omit: omit,
|
|
584
|
-
fromPairs: fromPairs,
|
|
585
|
-
concat: concat,
|
|
586
|
-
join: join,
|
|
587
|
-
map: map,
|
|
588
|
-
forEach: forEach,
|
|
589
|
-
both: both,
|
|
590
|
-
isEmpty: isEmpty,
|
|
591
|
-
empty: empty,
|
|
592
|
-
replace: replace,
|
|
593
|
-
filter: filter,
|
|
594
|
-
memoize: memoize,
|
|
595
|
-
mergeShallow: mergeShallow,
|
|
596
|
-
mergeDeep: mergeDeep,
|
|
597
|
-
mergeDeepX: mergeDeepX,
|
|
598
|
-
mergeDeepAdd: mergeDeepAdd,
|
|
599
|
-
overProp: overProp,
|
|
600
|
-
mapKeys: mapKeys,
|
|
601
|
-
zip: zip,
|
|
602
|
-
zipObj: zipObj,
|
|
603
|
-
zipWith: zipWith,
|
|
604
|
-
forEachSerial: forEachSerial,
|
|
605
|
-
waitAll: waitAll,
|
|
606
|
-
waitTap: waitTap,
|
|
607
|
-
forEachAsync: forEachAsync,
|
|
608
|
-
composeAsync: composeAsync,
|
|
609
|
-
mirror: mirror,
|
|
610
|
-
reflect: reflect,
|
|
611
|
-
echo: echo,
|
|
612
|
-
qappend: qappend,
|
|
613
|
-
qassoc: qassoc,
|
|
614
|
-
qreduce: qreduce,
|
|
615
|
-
qmergeDeep: qmergeDeep,
|
|
616
|
-
qmergeDeepX: qmergeDeepX,
|
|
617
|
-
qmergeDeepAdd: qmergeDeepAdd,
|
|
618
|
-
qmapKeys: qmapKeys,
|
|
619
|
-
qfilter: qfilter,
|
|
620
|
-
qindexOf: qindexOf,
|
|
621
|
-
getTmpl: getTmpl
|
|
622
|
-
});
|
|
623
|
-
|
|
624
|
-
window.pepka = pepka;
|
|
625
|
-
Object.assign(window, pepka);
|