Comparing version 0.1.5 to 0.2.0
@@ -1,1 +0,1 @@ | ||
const R=require("./compose"),add=(a,b)=>{if(b===void 0){return c=>add(a,c);}else{return a+b;}},adjust=(d,e,f)=>{if(e===void 0){return(g,h)=>adjust(d,g,h);}else if(f===void 0){return j=>adjust(d,e,j);}else{return f.map((k,l)=>{if(l===e){return d(f[e]);}else{return k;}});}},any=(m,n)=>{if(n===void 0){return o=>any(m,o);}else{let p=!1;n.map(q=>{if(m(q)===!0){p=!0;}});return p;}},append=(r,s)=>{if(s===void 0){return t=>append(r,t);}else{const u=s;u.unshift(r);return u;}},contains=(v,w)=>{if(w===void 0){return x=>contains(v,x);}else{return any(y=>v===y,w);}},filter=(z,A)=>{if(A===void 0){return B=>filter(z,B);}else{return A.filter(z);}},flatten=C=>{const D=[];C.map(E=>{if(E instanceof Array){E.map(F=>{if(F instanceof Array){F.map(G=>{if(G instanceof Array){D.push(...G);}else{D.push(G);}});}else{D.push(F);}});}else{D.push(E);}});return D;},drop=(H,I)=>{if(I===void 0){return J=>drop(H,J);}else{const K=I;return K.slice(H);}},dropLast=(L,M)=>{if(M===void 0){return N=>dropLast(L,N);}else{const O=M;return O.slice(0,-L);}},head=P=>dropLast(P.length-1,P),init=Q=>dropLast(1,Q),join=(S,T)=>{if(T===void 0){return U=>join(S,U);}else{return T.join(S);}},map=(V,W)=>{if(W===void 0){return X=>map(V,X);}else{return W.map(V);}},last=Y=>Y[Y.length-1],prepend=(Z,a1)=>{if(a1===void 0){return b1=>prepend(Z,b1);}else{const c1=a1;c1.push(Z);return c1;}},propEq=(d1,e1,f1)=>{if(e1===void 0){return(g1,h1)=>propEq(d1,g1,h1);}else if(f1===void 0){return i1=>propEq(d1,e1,i1);}else{return f1[d1]===e1;}},range=(j1,k1)=>{const l1=[];for(let i=j1;i<k1;i++){l1.push(i);}return l1;},repeat=(a,m1)=>{if(m1===void 0){return n1=>repeat(a,n1);}else{const o1=range(0,m1);return o1.fill(a);}},replace=(p1,q1,r1)=>{if(q1===void 0){return(s1,t1)=>replace(p1,s1,t1);}else if(r1===void 0){return u1=>replace(p1,q1,u1);}else{return r1.replace(p1,q1);}},subtract=(a,b)=>{if(b===void 0){return c=>subtract(a,c);}else{return a-b;}},sort=(fn,w1)=>{if(w1===void 0){return x1=>sort(fn,x1);}else{const y1=w1;return y1.sort(fn);}},sortBy=(fn,A1)=>{if(A1===void 0){return B1=>sortBy(fn,B1);}else{const C1=A1;return C1.sort((a,b)=>{const D1=fn(a),E1=fn(b);return D1<E1?-1:D1>E1?1:0;});}},split=(F1,G1)=>{if(G1===void 0){return H1=>split(F1,H1);}else{return G1.split(F1);}},splitEvery=(I1,a)=>{if(a===void 0){return J1=>splitEvery(I1,J1);}else{I1=I1>1?I1:1;const K1=[];let L1=0;while(L1<a.length){K1.push(a.slice(L1,L1+=I1));}return K1;}},tail=M1=>drop(1,M1),take=(N1,O1)=>{if(O1===void 0){return P1=>take(N1,P1);}else{const Q1=O1;return Q1.slice(0,N1);}},takeLast=(R1,S1)=>{if(S1===void 0){return T1=>dropLast(R1,T1);}else{const U1=S1;R1=R1>U1.length?U1.length:R1;return U1.slice(U1.length-R1);}},toLower=a=>a.toLowerCase(),toUpper=a=>a.toUpperCase(),test=(V1,W1)=>{if(W1===void 0){return X1=>test(V1,X1);}else{return W1.search(V1)===-1?!1:!0;}},type=a=>{if(a===null){return"Null";}else if(a.splice!==void 0){return"Array";}else if(a.freeze!==void 0){return"Object";}else if(typeof a==="boolean"){return"Boolean";}else if(typeof a==="number"){return"Number";}else if(typeof a==="string"){return"String";}else if(a===void 0){return"Undefined";}else if(a instanceof RegExp){return"RegExp";}return"Object";},values=Y1=>{const Z1=[];for(key in Y1){Z1.push(Y1[key]);}return Z1;},uniq=a2=>{const b2=[];return a2.filter(c2=>{if(b2.includes(c2)){return!1;}else{b2.push(c2);return!0;}});},update=(d2,e2,f2)=>{if(e2===void 0){return(g2,h2)=>update(d2,g2,h2);}else if(f2===void 0){return i2=>update(d2,e2,i2);}else{return f2.fill(d2,e2,e2+1);}};module.exports.add=add;module.exports.adjust=adjust;module.exports.any=any;module.exports.append=append;module.exports.contains=contains;module.exports.compose=R.compose;module.exports.drop=drop;module.exports.dropLast=dropLast;module.exports.filter=filter;module.exports.flatten=flatten;module.exports.head=head;module.exports.init=init;module.exports.join=join;module.exports.last=last;module.exports.map=map;module.exports.prepend=prepend;module.exports.propEq=propEq;module.exports.range=range;module.exports.repeat=repeat;module.exports.replace=replace;module.exports.sort=sort;module.exports.sortBy=sortBy;module.exports.split=split;module.exports.splitEvery=splitEvery;module.exports.subtract=subtract;module.exports.tail=tail;module.exports.take=take;module.exports.takeLast=takeLast;module.exports.test=test;module.exports.toLower=toLower;module.exports.toUpper=toUpper;module.exports.type=type;module.exports.values=values;module.exports.uniq=uniq;module.exports.update=update; | ||
const R=require("./_inc/compose"),add=(a,b)=>{if(b===void 0){return c=>add(a,c);}return a+b;},adjust=(d,e,f)=>{if(e===void 0){return(g,h)=>adjust(d,g,h);}else if(f===void 0){return j=>adjust(d,e,j);}return f.map((k,l)=>{if(l===e){return d(f[e]);}return k;});},any=(m,n)=>{if(n===void 0){return o=>any(m,o);}let p=!1;n.map(q=>{if(m(q)===!0){p=!0;}});return p;},append=(r,s)=>{if(s===void 0){return t=>append(r,t);}const u=s;u.unshift(r);return u;},contains=(v,w)=>{if(w===void 0){return x=>contains(v,x);}return any(y=>v===y,w);},filter=(z,A)=>{if(A===void 0){return B=>filter(z,B);}return A.filter(z);},find=(C,D)=>{if(D===void 0){return E=>find(C,E);}return D.find(C);},findIndex=(F,G)=>{if(G===void 0){return H=>findIndex(F,H);}return G.findIndex(F);},flatten=I=>{let J=[];for(let i=0;i<I.length;i++){if(Array.isArray(I[i])){J=J.concat(flatten(I[i]));}else{J.push(I[i]);}}return J;},drop=(K,L)=>{if(L===void 0){return M=>drop(K,M);}const N=L;return N.slice(K);},dropLast=(O,P)=>{if(P===void 0){return Q=>dropLast(O,Q);}const S=P;return S.slice(0,-O);},equals=(a,b)=>{if(b===void 0){return T=>equals(a,T);}else if(a===b){return a!==0||1/a===1/b;}const U=type(a);if(U!==type(b)){return!1;}if(U==="Array"){const V=a,W=b;return V.sort().toString()===W.sort().toString();}if(U==="Object"){const X=Object.keys(a);if(X.length===Object.keys(b).length){if(X.length===0){return!0;}let Y=!0;X.map(Z=>{if(Y){const a1=type(a[Z]),b1=type(b[Z]);if(a1===b1){if(a1==="Object"){if(Object.keys(a[Z]).length===Object.keys(b[Z]).length){if(Object.keys(a[Z]).length!==0){if(!equals(a[Z],b[Z])){Y=!1;}}}else{Y=!1;}}else if(!equals(a[Z],b[Z])){Y=!1;}}else{Y=!1;}}});return Y;}}return!1;},head=c1=>dropLast(c1.length-1,c1),indexOf=(d1,e1)=>{if(e1===void 0){return f1=>indexOf(d1,f1);}return e1.indexOf(d1);},init=g1=>dropLast(1,g1),join=(h1,i1)=>{if(i1===void 0){return j1=>join(h1,j1);}return i1.join(h1);},map=(fn,l1)=>{if(l1===void 0){return m1=>map(fn,m1);}return l1.map(fn);},last=n1=>n1[n1.length-1],length=o1=>o1.length,match=(p1,q1)=>{if(q1===void 0){return r1=>match(p1,r1);}const s1=q1.match(p1);return s1===null?[]:s1;},merge=(t1,u1)=>{if(u1===void 0){return v1=>merge(t1,v1);}return Object.assign({},t1,u1);},omit=(w1,x1)=>{if(x1===void 0){return y1=>omit(w1,y1);}const z1={};for(key in x1){if(!w1.includes(key)){z1[key]=x1[key];}}return z1;},path=(A1,B1)=>{if(B1===void 0){return C1=>path(A1,C1);}let D1=B1,E1=0;while(E1<A1.length){if(D1===null){return void 0;}D1=D1[A1[E1]];E1++;}return D1;},prepend=(F1,G1)=>{if(G1===void 0){return H1=>prepend(F1,H1);}const I1=G1;I1.push(F1);return I1;},pick=(J1,K1)=>{if(K1===void 0){return L1=>pick(J1,L1);}const M1={};for(key in K1){if(J1.includes(key)){M1[key]=K1[key];}}return M1;},prop=(N1,O1)=>{if(O1===void 0){return P1=>prop(N1,P1);}return O1[N1];},propEq=(Q1,R1,S1)=>{if(R1===void 0){return(T1,U1)=>propEq(Q1,T1,U1);}else if(S1===void 0){return V1=>propEq(Q1,R1,V1);}return S1[Q1]===R1;},range=(W1,X1)=>{const Y1=[];for(let i=W1;i<X1;i++){Y1.push(i);}return Y1;},repeat=(a,Z1)=>{if(Z1===void 0){return a2=>repeat(a,a2);}const b2=range(0,Z1);return b2.fill(a);},replace=(c2,d2,e2)=>{if(d2===void 0){return(f2,g2)=>replace(c2,f2,g2);}else if(e2===void 0){return h2=>replace(c2,d2,h2);}return e2.replace(c2,d2);},subtract=(a,b)=>{if(b===void 0){return c=>subtract(a,c);}return a-b;},sort=(fn,j2)=>{if(j2===void 0){return k2=>sort(fn,k2);}const l2=j2;return l2.sort(fn);},sortBy=(fn,n2)=>{if(n2===void 0){return o2=>sortBy(fn,o2);}const p2=n2;return p2.sort((a,b)=>{const q2=fn(a),r2=fn(b);return q2<r2?-1:q2>r2?1:0;});},split=(s2,t2)=>{if(t2===void 0){return u2=>split(s2,u2);}return t2.split(s2);},splitEvery=(v2,a)=>{if(a===void 0){return w2=>splitEvery(v2,w2);}v2=v2>1?v2:1;const x2=[];let y2=0;while(y2<a.length){x2.push(a.slice(y2,y2+=v2));}return x2;},tail=z2=>drop(1,z2),take=(A2,B2)=>{if(B2===void 0){return C2=>take(A2,C2);}const D2=B2;return D2.slice(0,A2);},takeLast=(E2,F2)=>{if(F2===void 0){return G2=>dropLast(E2,G2);}const H2=F2;E2=E2>H2.length?H2.length:E2;return H2.slice(H2.length-E2);},toLower=a=>a.toLowerCase(),toUpper=a=>a.toUpperCase(),test=(I2,J2)=>{if(J2===void 0){return K2=>test(I2,K2);}return J2.search(I2)===-1?!1:!0;},trim=L2=>L2.trim(),type=a=>{if(a===null){return"Null";}else if(Array.isArray(a)){return"Array";}else if(typeof a==="boolean"){return"Boolean";}else if(typeof a==="number"){return"Number";}else if(typeof a==="string"){return"String";}else if(a===void 0){return"Undefined";}else if(a instanceof RegExp){return"RegExp";}return"Object";},values=M2=>{const N2=[];for(key in M2){N2.push(M2[key]);}return N2;},uniq=O2=>{const P2=[];return O2.filter(Q2=>{if(P2.includes(Q2)){return!1;}P2.push(Q2);return!0;});},update=(R2,S2,T2)=>{if(S2===void 0){return(U2,V2)=>update(R2,U2,V2);}else if(T2===void 0){return W2=>update(R2,S2,W2);}return T2.fill(R2,S2,S2+1);};module.exports.add=add;module.exports.adjust=adjust;module.exports.any=any;module.exports.append=append;module.exports.compose=R.compose;module.exports.contains=contains;module.exports.drop=drop;module.exports.dropLast=dropLast;module.exports.equals=equals;module.exports.filter=filter;module.exports.find=find;module.exports.findIndex=findIndex;module.exports.flatten=flatten;module.exports.head=head;module.exports.indexOf=indexOf;module.exports.init=init;module.exports.join=join;module.exports.last=last;module.exports.length=length;module.exports.map=map;module.exports.match=match;module.exports.merge=merge;module.exports.omit=omit;module.exports.path=path;module.exports.pick=pick;module.exports.prepend=prepend;module.exports.prop=prop;module.exports.propEq=propEq;module.exports.range=range;module.exports.repeat=repeat;module.exports.replace=replace;module.exports.sort=sort;module.exports.sortBy=sortBy;module.exports.split=split;module.exports.splitEvery=splitEvery;module.exports.subtract=subtract;module.exports.tail=tail;module.exports.take=take;module.exports.takeLast=takeLast;module.exports.test=test;module.exports.toLower=toLower;module.exports.toUpper=toUpper;module.exports.trim=trim;module.exports.type=type;module.exports.uniq=uniq;module.exports.update=update;module.exports.values=values; |
{ | ||
"name": "rambda", | ||
"version": "0.1.5", | ||
"version": "0.2.0", | ||
"description": "Lightweight alternative to Ramda", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,2 +16,3 @@ [![Build Status](https://travis-ci.org/selfrefactor/ils.svg?branch=master)](https://travis-ci.org/selfrefactor/rambda) | ||
``` | ||
// npm i rambda | ||
const R = require("rambda") | ||
@@ -18,0 +19,0 @@ const result = R.compose( |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
153648
207
0