Comparing version 0.9.1 to 0.9.2
@@ -5,3 +5,3 @@ const R = require('../../rambda') | ||
expect( | ||
R.append('o','fo') | ||
R.append('o', 'fo') | ||
).toEqual('foo') | ||
@@ -8,0 +8,0 @@ }) |
@@ -5,3 +5,3 @@ const R = require('../../rambda') | ||
expect( | ||
R.prepend('f','oo') | ||
R.prepend('f', 'oo') | ||
).toEqual('foo') | ||
@@ -18,3 +18,2 @@ }) | ||
).toEqual([ 'foo' ]) | ||
}) |
const R = require('../../rambda') | ||
test('with undefined', () => { | ||
expect( | ||
R.defaultTo('foo')(undefined) | ||
).toEqual('foo') | ||
expect( | ||
R.defaultTo('foo')(undefined) | ||
).toEqual('foo') | ||
}) | ||
test('with null', () => { | ||
expect( | ||
R.defaultTo('foo')(null) | ||
).toEqual('foo') | ||
expect( | ||
R.defaultTo('foo')(null) | ||
).toEqual('foo') | ||
}) | ||
test('with NaN', () => { | ||
expect( | ||
R.defaultTo('foo')(NaN) | ||
).toEqual('foo') | ||
expect( | ||
R.defaultTo('foo')(NaN) | ||
).toEqual('foo') | ||
}) | ||
test('when inputArgument passes initial check', () => { | ||
expect( | ||
R.defaultTo('foo','bar') | ||
).toEqual('bar') | ||
expect( | ||
R.defaultTo('foo', 'bar') | ||
).toEqual('bar') | ||
}) |
const R = require('../../rambda') | ||
describe('equals', () => { | ||
it('', () => { | ||
expect( | ||
R.equals([ 1, 2, 3 ], [ 1, 2, 3 ]) | ||
).toBeTruthy() | ||
test('works with undefined as second argument', () => { | ||
expect( | ||
R.equals(1, undefined) | ||
).toBeFalsy() | ||
expect( | ||
R.equals([ 1, 2, 3 ], [ 1, 2 ]) | ||
).toBeFalsy() | ||
expect( | ||
R.equals(undefined, undefined) | ||
).toBeTruthy() | ||
}) | ||
expect( | ||
R.equals(1, 1) | ||
).toBeTruthy() | ||
test('', () => { | ||
expect( | ||
R.equals([ 1, 2, 3 ])([ 1, 2, 3 ]) | ||
).toBeTruthy() | ||
expect( | ||
R.equals(1, '1') | ||
).toBeFalsy() | ||
expect( | ||
R.equals([ 1, 2, 3 ], [ 1, 2 ]) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({}, {}) | ||
).toBeTruthy() | ||
expect( | ||
R.equals(1, 1) | ||
).toBeTruthy() | ||
expect( | ||
R.equals({ | ||
a : 1, | ||
b : 2, | ||
}, { | ||
b : 2, | ||
a : 1, | ||
}) | ||
).toBeTruthy() | ||
expect( | ||
R.equals(1, '1') | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ | ||
a : 1, | ||
b : 2, | ||
}, { | ||
a : 1, | ||
b : 1, | ||
}) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({}, {}) | ||
).toBeTruthy() | ||
expect( | ||
R.equals({ | ||
a : 1, | ||
b : false, | ||
}, { | ||
a : 1, | ||
b : 1, | ||
}) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ | ||
a : 1, | ||
b : 2, | ||
}, { | ||
b : 2, | ||
a : 1, | ||
}) | ||
).toBeTruthy() | ||
expect( | ||
R.equals({ | ||
expect( | ||
R.equals({ | ||
a : 1, | ||
b : 2, | ||
}, { | ||
a : 1, | ||
b : 1, | ||
}) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ | ||
a : 1, | ||
b : false, | ||
}, { | ||
a : 1, | ||
b : 1, | ||
}) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ | ||
a : 1, | ||
b : 2, | ||
}, { | ||
b : 2, | ||
a : 1, | ||
c : 3, | ||
}) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ | ||
x : { | ||
a : 1, | ||
b : 2, | ||
}, { | ||
}, | ||
}, { | ||
x : { | ||
b : 2, | ||
a : 1, | ||
c : 3, | ||
}) | ||
).toBeFalsy() | ||
}, | ||
}) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ | ||
x : { | ||
a : 1, | ||
b : 2, | ||
}, | ||
}, { | ||
x : { | ||
b : 2, | ||
a : 1, | ||
c : 3, | ||
}, | ||
}) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ | ||
a : 1, | ||
b : 2, | ||
}, { | ||
b : 3, | ||
a : 1, | ||
}) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ | ||
a : 1, | ||
b : 2, | ||
}, { | ||
b : 3, | ||
a : 1, | ||
}) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ a : { b : { c : 1 } } }, { a : { b : { c : 1 } } }) | ||
).toBeTruthy() | ||
expect( | ||
R.equals({ a : { b : { c : 1 } } }, { a : { b : { c : 1 } } }) | ||
).toBeTruthy() | ||
expect( | ||
R.equals({ a : { b : { c : 1 } } }, { a : { b : { c : 2 } } }) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ a : { b : { c : 1 } } }, { a : { b : { c : 2 } } }) | ||
).toBeFalsy() | ||
expect( | ||
R.equals({ a : {} }, { a : {} }) | ||
).toBeTruthy() | ||
expect( | ||
R.equals({ a : {} }, { a : {} }) | ||
).toBeTruthy() | ||
expect( | ||
R.equals('', '') | ||
).toBeTruthy() | ||
expect( | ||
R.equals('', '') | ||
).toBeTruthy() | ||
expect( | ||
R.equals('foo', 'foo') | ||
).toBeTruthy() | ||
expect( | ||
R.equals('foo', 'foo') | ||
).toBeTruthy() | ||
expect( | ||
R.equals('foo', 'bar') | ||
).toBeFalsy() | ||
expect( | ||
R.equals('foo', 'bar') | ||
).toBeFalsy() | ||
expect( | ||
R.equals(0, false) | ||
).toBeFalsy() | ||
expect( | ||
R.equals(0, false) | ||
).toBeFalsy() | ||
expect( | ||
R.equals(/\s/g, null) | ||
).toBeFalsy() | ||
expect( | ||
R.equals(/\s/g, null) | ||
).toBeFalsy() | ||
expect( | ||
R.equals(null, null) | ||
).toBeTruthy() | ||
expect( | ||
R.equals(null, null) | ||
).toBeTruthy() | ||
expect( | ||
R.equals(false)(null) | ||
).toBeFalsy() | ||
}) | ||
expect( | ||
R.equals(false)(null) | ||
).toBeFalsy() | ||
}) |
const R = require('../../rambda') | ||
test('', () => { | ||
expect( | ||
R.typedDefaultTo('foo')(undefined) | ||
).toEqual('foo') | ||
expect( | ||
R.typedDefaultTo('foo')(undefined) | ||
).toEqual('foo') | ||
expect( | ||
R.typedDefaultTo('foo', undefined) | ||
).toEqual('foo') | ||
expect( | ||
R.typedDefaultTo('foo', undefined) | ||
).toEqual('foo') | ||
expect( | ||
R.typedDefaultTo('foo', 1) | ||
).toEqual('foo') | ||
expect( | ||
R.typedDefaultTo('foo', 1) | ||
).toEqual('foo') | ||
expect( | ||
R.typedDefaultTo('foo', 'bar') | ||
).toEqual('bar') | ||
expect( | ||
R.typedDefaultTo('foo', 'bar') | ||
).toEqual('bar') | ||
expect( | ||
R.typedDefaultTo(undefined, 'bar') | ||
).toEqual(undefined) | ||
expect( | ||
R.typedDefaultTo(undefined, 'bar') | ||
).toEqual(undefined) | ||
}) |
const R = require('../../rambda') | ||
test('with undefined', () => { | ||
const result = R.pathOr('foo', 'x.y', {x: {y: 1}}) | ||
const result = R.pathOr('foo', 'x.y', { x : { y : 1 } }) | ||
expect( | ||
@@ -25,3 +25,3 @@ result | ||
test('curry case (x)(y)(z)', () => { | ||
const result = R.pathOr('foo')('x.y.z')({x:{y: {a:1}}}) | ||
const result = R.pathOr('foo')('x.y.z')({ x : { y : { a : 1 } } }) | ||
expect( | ||
@@ -33,3 +33,3 @@ result | ||
test('curry case (x)(y,z)', () => { | ||
const result = R.pathOr('foo', 'x.y.z')({x:{y: {a:1}}}) | ||
const result = R.pathOr('foo', 'x.y.z')({ x : { y : { a : 1 } } }) | ||
expect( | ||
@@ -41,3 +41,3 @@ result | ||
test('curry case (x,y)(z)', () => { | ||
const result = R.pathOr('foo')('x.y.z',{x:{y: {a:1}}}) | ||
const result = R.pathOr('foo')('x.y.z', { x : { y : { a : 1 } } }) | ||
expect( | ||
@@ -44,0 +44,0 @@ result |
@@ -6,4 +6,4 @@ const R = require('../../rambda') | ||
const y = 'a.b.c' | ||
const z = {a: {b:{c:1}}} | ||
const result = R.typedPathOr(x,y,z) | ||
const z = { a : { b : { c : 1 } } } | ||
const result = R.typedPathOr(x, y, z) | ||
expect( | ||
@@ -17,3 +17,3 @@ result | ||
const y = 'a.b.c' | ||
const z = {a: {b:{c:1}}} | ||
const z = { a : { b : { c : 1 } } } | ||
const result = R.typedPathOr(x)(y)(z) | ||
@@ -28,4 +28,4 @@ expect( | ||
const y = 'a.b.c' | ||
const z = {a: {b:{c:1}}} | ||
const result = R.typedPathOr(x)(y,z) | ||
const z = { a : { b : { c : 1 } } } | ||
const result = R.typedPathOr(x)(y, z) | ||
expect( | ||
@@ -39,4 +39,4 @@ result | ||
const y = 'a.b.c' | ||
const z = {a: {b:{c:1}}} | ||
const result = R.typedPathOr(x,y,z) | ||
const z = { a : { b : { c : 1 } } } | ||
const result = R.typedPathOr(x, y, z) | ||
expect( | ||
@@ -50,4 +50,4 @@ result | ||
const y = 'a.b.c' | ||
const z = {a: {b:{c:1}}} | ||
const result = R.typedPathOr(x,y)(z) | ||
const z = { a : { b : { c : 1 } } } | ||
const result = R.typedPathOr(x, y)(z) | ||
expect( | ||
@@ -54,0 +54,0 @@ result |
@@ -12,3 +12,3 @@ const R = require('../rambda') | ||
expect( | ||
R.replace(/\s/g)('|','foo bar baz') | ||
R.replace(/\s/g)('|', 'foo bar baz') | ||
).toEqual('foo|bar|baz') | ||
@@ -15,0 +15,0 @@ expect( |
@@ -171,11 +171,7 @@ 'use strict'; | ||
function all(condition, arr) { | ||
if (arguments.length === 1) { | ||
return function (arrHolder) { | ||
return all(condition, arrHolder); | ||
}; | ||
} | ||
return filter$1(condition, arr).length === arr.length; | ||
} | ||
var all$1 = curry(all); | ||
function any(fn, arr) { | ||
@@ -204,3 +200,3 @@ var counter = 0; | ||
return !condition(x); | ||
})(conditions); | ||
}, conditions); | ||
} | ||
@@ -473,2 +469,8 @@ | ||
function equals(a, b) { | ||
if (arguments.length === 1) { | ||
return function (bHolder) { | ||
return equals(a, bHolder); | ||
}; | ||
} | ||
if (a === b) { | ||
@@ -527,4 +529,2 @@ return true; | ||
var equals$1 = curry(equals); | ||
function contains(val, arr) { | ||
@@ -534,3 +534,3 @@ var index = -1; | ||
while (++index < arr.length && !flag) { | ||
if (equals$1(arr[index], val)) { | ||
if (equals(arr[index], val)) { | ||
flag = true; | ||
@@ -1037,3 +1037,3 @@ } | ||
return !(type(inputArgument) === type(defaultArgument)) ? defaultArgument : inputArgument; | ||
return type(inputArgument) !== type(defaultArgument) ? defaultArgument : inputArgument; | ||
} | ||
@@ -1146,3 +1146,3 @@ | ||
exports.adjust = adjust$1; | ||
exports.all = all; | ||
exports.all = all$1; | ||
exports.allPass = allPass; | ||
@@ -1162,3 +1162,3 @@ exports.anyPass = anyPass; | ||
exports.inc = inc; | ||
exports.equals = equals$1; | ||
exports.equals = equals; | ||
exports.filter = filter$1; | ||
@@ -1165,0 +1165,0 @@ exports.find = find$1; |
@@ -167,11 +167,7 @@ function helper(method, x, y) { | ||
function all(condition, arr) { | ||
if (arguments.length === 1) { | ||
return function (arrHolder) { | ||
return all(condition, arrHolder); | ||
}; | ||
} | ||
return filter$1(condition, arr).length === arr.length; | ||
} | ||
var all$1 = curry(all); | ||
function any(fn, arr) { | ||
@@ -200,3 +196,3 @@ var counter = 0; | ||
return !condition(x); | ||
})(conditions); | ||
}, conditions); | ||
} | ||
@@ -469,2 +465,8 @@ | ||
function equals(a, b) { | ||
if (arguments.length === 1) { | ||
return function (bHolder) { | ||
return equals(a, bHolder); | ||
}; | ||
} | ||
if (a === b) { | ||
@@ -523,4 +525,2 @@ return true; | ||
var equals$1 = curry(equals); | ||
function contains(val, arr) { | ||
@@ -530,3 +530,3 @@ var index = -1; | ||
while (++index < arr.length && !flag) { | ||
if (equals$1(arr[index], val)) { | ||
if (equals(arr[index], val)) { | ||
flag = true; | ||
@@ -1033,3 +1033,3 @@ } | ||
return !(type(inputArgument) === type(defaultArgument)) ? defaultArgument : inputArgument; | ||
return type(inputArgument) !== type(defaultArgument) ? defaultArgument : inputArgument; | ||
} | ||
@@ -1115,3 +1115,3 @@ | ||
export { add, always, complement, concat, divide, endsWith, F, identity, includes, join, lastIndexOf, length, modulo, multiply, not, padEnd, padStart, reverse, startsWith, subtract, T, toLower, toString, toUpper, trim, addIndex, adjust$1 as adjust, all, allPass, anyPass, any$1 as any, append$1 as append, both$1 as both, compose, contains$1 as contains, curry$1 as curry, dec, defaultTo, drop$1 as drop, dropLast$1 as dropLast, either$1 as either, inc, equals$1 as equals, filter$1 as filter, find$1 as find, findIndex$1 as findIndex, flatten, flip, has$1 as has, head, ifElse$1 as ifElse, isNil, indexOf$1 as indexOf, init, last, map$1 as map, match$1 as match, merge$1 as merge, omit, partialCurry, path, pathOr$1 as pathOr, pick, pipe, pluck$1 as pluck, prepend$1 as prepend, prop$1 as prop, propEq$1 as propEq, range, reduce$1 as reduce, repeat$1 as repeat, replace$1 as replace, sort$1 as sort, sortBy$1 as sortBy, split$1 as split, splitEvery$1 as splitEvery, tap$1 as tap, tail, take$1 as take, takeLast$1 as takeLast, test$1 as test, type, typedPathOr$1 as typedPathOr, typedDefaultTo, uniq, update$1 as update, values }; | ||
export { add, always, complement, concat, divide, endsWith, F, identity, includes, join, lastIndexOf, length, modulo, multiply, not, padEnd, padStart, reverse, startsWith, subtract, T, toLower, toString, toUpper, trim, addIndex, adjust$1 as adjust, all$1 as all, allPass, anyPass, any$1 as any, append$1 as append, both$1 as both, compose, contains$1 as contains, curry$1 as curry, dec, defaultTo, drop$1 as drop, dropLast$1 as dropLast, either$1 as either, inc, equals, filter$1 as filter, find$1 as find, findIndex$1 as findIndex, flatten, flip, has$1 as has, head, ifElse$1 as ifElse, isNil, indexOf$1 as indexOf, init, last, map$1 as map, match$1 as match, merge$1 as merge, omit, partialCurry, path, pathOr$1 as pathOr, pick, pipe, pluck$1 as pluck, prepend$1 as prepend, prop$1 as prop, propEq$1 as propEq, range, reduce$1 as reduce, repeat$1 as repeat, replace$1 as replace, sort$1 as sort, sortBy$1 as sortBy, split$1 as split, splitEvery$1 as splitEvery, tap$1 as tap, tail, take$1 as take, takeLast$1 as takeLast, test$1 as test, type, typedPathOr$1 as typedPathOr, typedDefaultTo, uniq, update$1 as update, values }; | ||
//# sourceMappingURL=rambda.esm.js.map |
@@ -1,1 +0,1 @@ | ||
(function(c,d){typeof exports==='object'&&typeof module!=='undefined'?d(exports):typeof define==='function'&&define.amd?define(['exports'],d):d(c.R={});})(this,function(e){'use strict';function helper(g,x,y){if(x===void 0){return function(h,j){return helper(g,h,j);};}else if(y===void 0){return function(k){return helper(g,x,k);};}if(y[g]!==void 0){return y[g](x);}}function curry(l){return function(x,y){if(y===void 0){return function(m){return l(x,m);};}return l(x,y);};}function curryThree(n){return function(x,y,z){if(y===void 0){var helper=function helper(q,r){return n(x,q,r);};return curry(helper);}else if(z===void 0){return function(s){return n(x,y,s);};}return n(x,y,z);};}function mathHelper(t,x,y){switch(t){case'+':return x+y;case'-':return x-y;case'/':return x/y;case'*':return x*y;case'%':return x%y;}}var u=curryThree(mathHelper);function oppositeHelper(v,x,y){if(x===void 0){return function(w,A){return oppositeHelper(v,w,A);};}else if(y===void 0){return function(B){return oppositeHelper(v,x,B);};}if(x[v]!==void 0){return x[v](y);}}function propHelper(C,x){if(x===void 0){return function(D){return propHelper(C,D);};}return x[C];}function simpleHelper(E,x){if(x===void 0){return function(G){return simpleHelper(E,G);};}if(x[E]!==void 0){return x[E]();}}function addIndex(H){return function(I){for(var J=0,newFn=function newFn(){for(var K=arguments.length,L=Array(K),M=0;M<K;M++){L[M]=arguments[M];}return I.apply(null,[].concat(L,[J++]));},N=arguments.length,O=Array(N>1?N-1:0),P=1;P<N;P++){O[P-1]=arguments[P];}return H.apply(null,[newFn].concat(O));};}function adjust(Q,R,S){var U=S.concat();return U.map(function(V,W){if(W===R){return Q(S[R]);}return V;});}var X=curryThree(adjust);function filterObject(Y,Z){var a1={};for(var b1 in Z){if(Y(Z[b1])){a1[b1]=Z[b1];}}return a1;}function filter(fn,d1){if(d1.length===void 0){return filterObject(fn,d1);}var e1=-1,f1=0,g1=d1.length,h1=[];while(++e1<g1){var i1=d1[e1];if(fn(i1)){h1[f1++]=i1;}}return h1;}var j1=curry(filter);function all(k1,l1){if(arguments.length===1){return function(m1){return all(k1,m1);};}return j1(k1,l1).length===l1.length;}function any(fn,o1){var p1=0;while(p1<o1.length){if(fn(o1[p1])){return!0;}p1++;}return!1;}var q1=curry(any);function allPass(r1,x){if(arguments.length===1){return function(s1){return allPass(r1,s1);};}return!q1(function(t1){return!t1(x);})(r1);}function anyPass(u1,x){if(arguments.length===1){return function(v1){return anyPass(u1,v1);};}return q1(function(w1){return w1(x);})(u1);}function append(x1,y1){if(typeof y1==='string'){return''+y1+x1;}var z1=y1.concat();z1.push(x1);return z1;}var A1=curry(append);function both(x,y){return function(B1){return x(B1)&&y(B1);};}var C1=curry(both);function compose(){for(var D1=arguments.length,E1=Array(D1),F1=0;F1<D1;F1++){E1[F1]=arguments[F1];}return function(G1){var H1=E1.slice();while(H1.length>0){G1=H1.pop()(G1);}return G1;};}var I1={},J1=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(K1){return typeof K1;}:function(L1){return L1&&typeof Symbol==="function"&&L1.constructor===Symbol&&L1!==Symbol.prototype?"symbol":typeof L1;},M1=function(){function AwaitValue(N1){this.value=N1;}function AsyncGenerator(O1){var P1,Q1;function send(R1,S1){return new Promise(function(T1,U1){var V1={key:R1,arg:S1,resolve:T1,reject:U1,next:null};if(Q1){Q1=Q1.next=V1;}else{P1=Q1=V1;resume(R1,S1);}});}function resume(W1,X1){try{var Y1=O1[W1](X1),Z1=Y1.value;if(Z1 instanceof AwaitValue){Promise.resolve(Z1.value).then(function(a2){resume("next",a2);},function(b2){resume("throw",b2);});}else{settle(Y1.done?"return":"normal",Y1.value);}}catch(err){settle("throw",err);}}function settle(c2,d2){switch(c2){case"return":P1.resolve({value:d2,done:!0});break;case"throw":P1.reject(d2);break;default:P1.resolve({value:d2,done:!1});break;}P1=P1.next;if(P1){resume(P1.key,P1.arg);}else{Q1=null;}}this._invoke=send;if(typeof O1.return!=="function"){this.return=void 0;}}if(typeof Symbol==="function"&&Symbol.asyncIterator){AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this;};}AsyncGenerator.prototype.next=function(e2){return this._invoke("next",e2);};AsyncGenerator.prototype.throw=function(f2){return this._invoke("throw",f2);};AsyncGenerator.prototype.return=function(g2){return this._invoke("return",g2);};return{wrap:function(fn){return function(){return new AsyncGenerator(fn.apply(this,arguments));};},await:function(i2){return new AwaitValue(i2);}};}(),toConsumableArray=function(j2){if(Array.isArray(j2)){for(var i=0,k2=Array(j2.length);i<j2.length;i++)k2[i]=j2[i];return k2;}else{return Array.from(j2);}};I1;function type(a){var l2=typeof a==='undefined'?'undefined':J1(a);if(a===null){return'Null';}else if(a===void 0){return'Undefined';}else if(l2==='boolean'){return'Boolean';}else if(l2==='number'){return'Number';}else if(l2==='string'){return'String';}else if(Array.isArray(a)){return'Array';}else if(a instanceof RegExp){return'RegExp';}var m2=a.toString();if(m2.startsWith('async')){return'Async';}else if(m2==='[object Promise]'){return'Promise';}else if(m2.includes('function')||m2.includes('=>')){return'Function';}return'Object';}function equals(a,b){if(a===b){return!0;}var n2=type(a);if(n2!==type(b)){return!1;}if(n2==='Array'){var o2=Array.from(a),p2=Array.from(b);return o2.sort().toString()===p2.sort().toString();}if(n2==='Object'){var q2=Object.keys(a);if(q2.length===Object.keys(b).length){if(q2.length===0){return!0;}var r2=!0;q2.map(function(s2){if(r2){var t2=type(a[s2]),u2=type(b[s2]);if(t2===u2){if(t2==='Object'){if(Object.keys(a[s2]).length===Object.keys(b[s2]).length){if(Object.keys(a[s2]).length!==0){if(!equals(a[s2],b[s2])){r2=!1;}}}else{r2=!1;}}else if(!equals(a[s2],b[s2])){r2=!1;}}else{r2=!1;}}});return r2;}}return!1;}var v2=curry(equals);function contains(w2,x2){var y2=-1,z2=!1;while(++y2<x2.length&&!z2){if(v2(x2[y2],w2)){z2=!0;}}return z2;}var A2=curry(contains);function curry$1(f){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return function(){for(var B2=arguments.length,p=Array(B2),C2=0;C2<B2;C2++){p[C2]=arguments[C2];}return function(o){return o.length>=f.length?f.apply(void 0,toConsumableArray(o)):curry$1(f,o);}([].concat(toConsumableArray(a),p));};}var dec=function(x){return x-1;};function defaultTo(D2,E2){if(arguments.length===1){return function(F2){return defaultTo(D2,F2);};}return E2===void 0||E2===null||Number.isNaN(E2)===!0?D2:E2;}function drop(G2,a){return a.slice(G2);}var H2=curry(drop);function dropLast(I2,a){return a.slice(0,-I2);}var J2=curry(dropLast);function either(x,y){return function(K2){return x(K2)||y(K2);};}var L2=curry(either),inc=function(x){return x+1;};function find(fn,N2){return N2.find(fn);}var O2=curry(find);function findIndex(fn,Q2){var R2=Q2.length,S2=-1;while(++S2<R2){if(fn(Q2[S2])){return S2;}}return-1;}var T2=curry(findIndex);function flatten(U2,V2){V2=V2===void 0?[]:V2;for(var i=0;i<U2.length;i++){if(Array.isArray(U2[i])){flatten(U2[i],V2);}else{V2.push(U2[i]);}}return V2;}function flipExport(fn){return function(){for(var X2=arguments.length,Y2=Array(X2),Z2=0;Z2<X2;Z2++){Y2[Z2]=arguments[Z2];}if(Y2.length===1){return function(a3){return fn(a3,Y2[0]);};}else if(Y2.length===2){return fn(Y2[1],Y2[0]);}return void 0;};}function flip(fn){return flipExport(fn);}function has(c3,d3){return d3[c3]!==void 0;}var e3=curry(has);function head(a){if(typeof a==='string'){return a[0]||'';}return a[0];}function ifElse(f3,g3,h3){return function(i3){if(f3(i3)===!0){return g3(i3);}return h3(i3);};}var j3=curryThree(ifElse);function isNil(x){return x===void 0||x===null;}function indexOf(x,k3){var l3=-1,m3=k3.length;while(++l3<m3){if(k3[l3]===x){return l3;}}return-1;}var n3=curry(indexOf);function baseSlice(o3,p3,q3){var r3=-1,s3=o3.length;q3=q3>s3?s3:q3;if(q3<0){q3+=s3;}s3=p3>q3?0:q3-p3>>>0;p3>>>=0;var t3=Array(s3);while(++r3<s3){t3[r3]=o3[r3+p3];}return t3;}function init(a){if(typeof a==='string'){return a.slice(0,-1);}return a.length?baseSlice(a,0,-1):[];}function last(a){if(typeof a==='string'){return a[a.length-1]||'';}return a[a.length-1];}function mapObject(fn,v3){var w3={};for(var x3 in v3){w3[x3]=fn(v3[x3]);}return w3;}function map(fn,z3){if(z3.length===void 0){return mapObject(fn,z3);}var A3=-1,B3=z3.length,C3=Array(B3);while(++A3<B3){C3[A3]=fn(z3[A3]);}return C3;}var D3=curry(map);function match(E3,F3){var G3=F3.match(E3);return G3===null?[]:G3;}var H3=curry(match);function merge(I3,J3){return Object.assign({},I3,J3);}var K3=curry(merge);function omit(L3,M3){if(arguments.length===1){return function(N3){return omit(L3,N3);};}if(M3===void 0||M3===null){return void 0;}if(typeof L3==='string'){L3=L3.split(',').map(function(x){return x.trim();});}var O3={};for(var P3 in M3){if(!L3.includes(P3)){O3[P3]=M3[P3];}}return O3;}function partialCurry(fn){var R3=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(S3){if(type(fn)==='Async'||type(fn)==='Promise'){return new Promise(function(T3,U3){fn(K3(S3,R3)).then(T3).catch(U3);});}return fn(K3(S3,R3));};}function path(V3,W3){if(arguments.length===1){return function(X3){return path(V3,X3);};}if(W3===null||W3===void 0){return void 0;}var Y3=W3,Z3=0;if(typeof V3==='string'){V3=V3.split('.');}while(Z3<V3.length){if(Y3===null||Y3===void 0){return void 0;}Y3=Y3[V3[Z3]];Z3++;}return Y3;}function pathOr(a4,b4,c4){return defaultTo(a4,path(b4,c4));}var d4=curry$1(pathOr);function pick(e4,f4){if(arguments.length===1){return function(g4){return pick(e4,g4);};}if(!(type(f4)==='Object')){return void 0;}if(type(e4)==='String'){e4=e4.split(',').map(function(x){return x.trim();});}var h4={},i4=0;while(i4<e4.length){if(e4[i4]in f4){h4[e4[i4]]=f4[e4[i4]];}i4++;}return h4;}function pipe(){for(var j4=arguments.length,k4=Array(j4),l4=0;l4<j4;l4++){k4[l4]=arguments[l4];}return compose.apply(void 0,toConsumableArray(k4.reverse()));}function pluck(m4,n4){var o4=[];D3(function(p4){if(!(p4[m4]===void 0)){o4.push(p4[m4]);}},n4);return o4;}var q4=curry(pluck);function prepend(r4,s4){if(typeof s4==='string'){return''+r4+s4;}var t4=s4.concat();t4.unshift(r4);return t4;}var u4=curry(prepend);function prop(v4,w4){return w4[v4];}var x4=curry(prop);function propEq(y4,z4,A4){return A4[y4]===z4;}var B4=curryThree(propEq);function range(C4,D4){for(var E4=[],i=C4;i<D4;i++){E4.push(i);}return E4;}function reduce(fn,G4,H4){return H4.reduce(fn,G4);}var I4=curryThree(reduce);function repeat(a,J4){var K4=Array(J4);return K4.fill(a);}var L4=curry(repeat);function replace(M4,N4,O4){return O4.replace(M4,N4);}var P4=curryThree(replace);function sort(fn,R4){var S4=R4.concat();return S4.sort(fn);}var T4=curry(sort);function sortBy(fn,V4){var W4=V4.concat();return W4.sort(function(a,b){var X4=fn(a),Y4=fn(b);return X4<Y4?-1:X4>Y4?1:0;});}var Z4=curry(sortBy);function split(a5,b5){return b5.split(a5);}var c5=curry(split);function splitEvery(d5,a){d5=d5>1?d5:1;var e5=[],f5=0;while(f5<a.length){e5.push(a.slice(f5,f5+=d5));}return e5;}var g5=curry(splitEvery);function tap(fn,i5){fn(i5);return i5;}var j5=curry(tap);function tail(k5){return H2(1,k5);}function take(l5,a){if(typeof a==='string'){return a.slice(0,l5);}return baseSlice(a,0,l5);}var m5=curry(take);function takeLast(n5,a){var o5=a.length;n5=n5>o5?o5:n5;if(typeof a==='string'){return a.slice(o5-n5);}n5=o5-n5;return baseSlice(a,n5,o5);}var p5=curry(takeLast);function test(q5,r5){return r5.search(q5)!==-1;}var s5=curry(test);function typedDefaultTo(t5,u5){if(arguments.length===1){return function(v5){return typedDefaultTo(t5,v5);};}return!(type(u5)===type(t5))?t5:u5;}function typedPathOr(w5,x5,y5){return typedDefaultTo(w5,path(x5,y5));}var z5=curry$1(typedPathOr);function uniq(A5){var B5=-1,C5=[];while(++B5<A5.length){var D5=A5[B5];if(!A2(D5,C5)){C5.push(D5);}}return C5;}function update(E5,F5,G5){var H5=G5.concat();return H5.fill(F5,E5,E5+1);}var I5=curryThree(update);function values(J5){var K5=[];for(var L5 in J5){K5.push(J5[L5]);}return K5;}var M5=u('+'),always=function always(x){return function(){return x;};},complement=function complement(fn){return function(O5){return!fn(O5);};},P5=oppositeHelper('concat'),Q5=u('/'),R5=helper('endsWith'),F=function F(){return!1;},identity=function identity(x){return x;},S5=helper('includes'),T5=helper('join'),U5=helper('lastIndexOf'),V5=propHelper('length'),W5=u('%'),X5=u('*'),not=function not(x){return!x;},Y5=helper('padEnd'),Z5=helper('padStart'),a6=simpleHelper('reverse'),b6=helper('startsWith'),c6=u('-'),T=function T(){return!0;},d6=simpleHelper('toLowerCase'),e6=simpleHelper('toString'),f6=simpleHelper('toUpperCase'),g6=simpleHelper('trim');e.add=M5;e.always=always;e.complement=complement;e.concat=P5;e.divide=Q5;e.endsWith=R5;e.F=F;e.identity=identity;e.includes=S5;e.join=T5;e.lastIndexOf=U5;e.length=V5;e.modulo=W5;e.multiply=X5;e.not=not;e.padEnd=Y5;e.padStart=Z5;e.reverse=a6;e.startsWith=b6;e.subtract=c6;e.T=T;e.toLower=d6;e.toString=e6;e.toUpper=f6;e.trim=g6;e.addIndex=addIndex;e.adjust=X;e.all=all;e.allPass=allPass;e.anyPass=anyPass;e.any=q1;e.append=A1;e.both=C1;e.compose=compose;e.contains=A2;e.curry=curry$1;e.dec=dec;e.defaultTo=defaultTo;e.drop=H2;e.dropLast=J2;e.either=L2;e.inc=inc;e.equals=v2;e.filter=j1;e.find=O2;e.findIndex=T2;e.flatten=flatten;e.flip=flip;e.has=e3;e.head=head;e.ifElse=j3;e.isNil=isNil;e.indexOf=n3;e.init=init;e.last=last;e.map=D3;e.match=H3;e.merge=K3;e.omit=omit;e.partialCurry=partialCurry;e.path=path;e.pathOr=d4;e.pick=pick;e.pipe=pipe;e.pluck=q4;e.prepend=u4;e.prop=x4;e.propEq=B4;e.range=range;e.reduce=I4;e.repeat=L4;e.replace=P4;e.sort=T4;e.sortBy=Z4;e.split=c5;e.splitEvery=g5;e.tap=j5;e.tail=tail;e.take=m5;e.takeLast=p5;e.test=s5;e.type=type;e.typedPathOr=z5;e.typedDefaultTo=typedDefaultTo;e.uniq=uniq;e.update=I5;e.values=values;Object.defineProperty(e,'__esModule',{value:!0});}); | ||
(function(c,d){typeof exports==='object'&&typeof module!=='undefined'?d(exports):typeof define==='function'&&define.amd?define(['exports'],d):d(c.R={});})(this,function(e){'use strict';function helper(g,x,y){if(x===void 0){return function(h,j){return helper(g,h,j);};}else if(y===void 0){return function(k){return helper(g,x,k);};}if(y[g]!==void 0){return y[g](x);}}function curry(l){return function(x,y){if(y===void 0){return function(m){return l(x,m);};}return l(x,y);};}function curryThree(n){return function(x,y,z){if(y===void 0){var helper=function helper(q,r){return n(x,q,r);};return curry(helper);}else if(z===void 0){return function(s){return n(x,y,s);};}return n(x,y,z);};}function mathHelper(t,x,y){switch(t){case'+':return x+y;case'-':return x-y;case'/':return x/y;case'*':return x*y;case'%':return x%y;}}var u=curryThree(mathHelper);function oppositeHelper(v,x,y){if(x===void 0){return function(w,A){return oppositeHelper(v,w,A);};}else if(y===void 0){return function(B){return oppositeHelper(v,x,B);};}if(x[v]!==void 0){return x[v](y);}}function propHelper(C,x){if(x===void 0){return function(D){return propHelper(C,D);};}return x[C];}function simpleHelper(E,x){if(x===void 0){return function(G){return simpleHelper(E,G);};}if(x[E]!==void 0){return x[E]();}}function addIndex(H){return function(I){for(var J=0,newFn=function newFn(){for(var K=arguments.length,L=Array(K),M=0;M<K;M++){L[M]=arguments[M];}return I.apply(null,[].concat(L,[J++]));},N=arguments.length,O=Array(N>1?N-1:0),P=1;P<N;P++){O[P-1]=arguments[P];}return H.apply(null,[newFn].concat(O));};}function adjust(Q,R,S){var U=S.concat();return U.map(function(V,W){if(W===R){return Q(S[R]);}return V;});}var X=curryThree(adjust);function filterObject(Y,Z){var a1={};for(var b1 in Z){if(Y(Z[b1])){a1[b1]=Z[b1];}}return a1;}function filter(fn,d1){if(d1.length===void 0){return filterObject(fn,d1);}var e1=-1,f1=0,g1=d1.length,h1=[];while(++e1<g1){var i1=d1[e1];if(fn(i1)){h1[f1++]=i1;}}return h1;}var j1=curry(filter);function all(k1,l1){return j1(k1,l1).length===l1.length;}var m1=curry(all);function any(fn,o1){var p1=0;while(p1<o1.length){if(fn(o1[p1])){return!0;}p1++;}return!1;}var q1=curry(any);function allPass(r1,x){if(arguments.length===1){return function(s1){return allPass(r1,s1);};}return!q1(function(t1){return!t1(x);},r1);}function anyPass(u1,x){if(arguments.length===1){return function(v1){return anyPass(u1,v1);};}return q1(function(w1){return w1(x);})(u1);}function append(x1,y1){if(typeof y1==='string'){return''+y1+x1;}var z1=y1.concat();z1.push(x1);return z1;}var A1=curry(append);function both(x,y){return function(B1){return x(B1)&&y(B1);};}var C1=curry(both);function compose(){for(var D1=arguments.length,E1=Array(D1),F1=0;F1<D1;F1++){E1[F1]=arguments[F1];}return function(G1){var H1=E1.slice();while(H1.length>0){G1=H1.pop()(G1);}return G1;};}var I1={},J1=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(K1){return typeof K1;}:function(L1){return L1&&typeof Symbol==="function"&&L1.constructor===Symbol&&L1!==Symbol.prototype?"symbol":typeof L1;},M1=function(){function AwaitValue(N1){this.value=N1;}function AsyncGenerator(O1){var P1,Q1;function send(R1,S1){return new Promise(function(T1,U1){var V1={key:R1,arg:S1,resolve:T1,reject:U1,next:null};if(Q1){Q1=Q1.next=V1;}else{P1=Q1=V1;resume(R1,S1);}});}function resume(W1,X1){try{var Y1=O1[W1](X1),Z1=Y1.value;if(Z1 instanceof AwaitValue){Promise.resolve(Z1.value).then(function(a2){resume("next",a2);},function(b2){resume("throw",b2);});}else{settle(Y1.done?"return":"normal",Y1.value);}}catch(err){settle("throw",err);}}function settle(c2,d2){switch(c2){case"return":P1.resolve({value:d2,done:!0});break;case"throw":P1.reject(d2);break;default:P1.resolve({value:d2,done:!1});break;}P1=P1.next;if(P1){resume(P1.key,P1.arg);}else{Q1=null;}}this._invoke=send;if(typeof O1.return!=="function"){this.return=void 0;}}if(typeof Symbol==="function"&&Symbol.asyncIterator){AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this;};}AsyncGenerator.prototype.next=function(e2){return this._invoke("next",e2);};AsyncGenerator.prototype.throw=function(f2){return this._invoke("throw",f2);};AsyncGenerator.prototype.return=function(g2){return this._invoke("return",g2);};return{wrap:function(fn){return function(){return new AsyncGenerator(fn.apply(this,arguments));};},await:function(i2){return new AwaitValue(i2);}};}(),toConsumableArray=function(j2){if(Array.isArray(j2)){for(var i=0,k2=Array(j2.length);i<j2.length;i++)k2[i]=j2[i];return k2;}else{return Array.from(j2);}};I1;function type(a){var l2=typeof a==='undefined'?'undefined':J1(a);if(a===null){return'Null';}else if(a===void 0){return'Undefined';}else if(l2==='boolean'){return'Boolean';}else if(l2==='number'){return'Number';}else if(l2==='string'){return'String';}else if(Array.isArray(a)){return'Array';}else if(a instanceof RegExp){return'RegExp';}var m2=a.toString();if(m2.startsWith('async')){return'Async';}else if(m2==='[object Promise]'){return'Promise';}else if(m2.includes('function')||m2.includes('=>')){return'Function';}return'Object';}function equals(a,b){if(arguments.length===1){return function(n2){return equals(a,n2);};}if(a===b){return!0;}var o2=type(a);if(o2!==type(b)){return!1;}if(o2==='Array'){var p2=Array.from(a),q2=Array.from(b);return p2.sort().toString()===q2.sort().toString();}if(o2==='Object'){var r2=Object.keys(a);if(r2.length===Object.keys(b).length){if(r2.length===0){return!0;}var s2=!0;r2.map(function(t2){if(s2){var u2=type(a[t2]),v2=type(b[t2]);if(u2===v2){if(u2==='Object'){if(Object.keys(a[t2]).length===Object.keys(b[t2]).length){if(Object.keys(a[t2]).length!==0){if(!equals(a[t2],b[t2])){s2=!1;}}}else{s2=!1;}}else if(!equals(a[t2],b[t2])){s2=!1;}}else{s2=!1;}}});return s2;}}return!1;}function contains(w2,x2){var y2=-1,z2=!1;while(++y2<x2.length&&!z2){if(equals(x2[y2],w2)){z2=!0;}}return z2;}var A2=curry(contains);function curry$1(f){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return function(){for(var B2=arguments.length,p=Array(B2),C2=0;C2<B2;C2++){p[C2]=arguments[C2];}return function(o){return o.length>=f.length?f.apply(void 0,toConsumableArray(o)):curry$1(f,o);}([].concat(toConsumableArray(a),p));};}var dec=function(x){return x-1;};function defaultTo(D2,E2){if(arguments.length===1){return function(F2){return defaultTo(D2,F2);};}return E2===void 0||E2===null||Number.isNaN(E2)===!0?D2:E2;}function drop(G2,a){return a.slice(G2);}var H2=curry(drop);function dropLast(I2,a){return a.slice(0,-I2);}var J2=curry(dropLast);function either(x,y){return function(K2){return x(K2)||y(K2);};}var L2=curry(either),inc=function(x){return x+1;};function find(fn,N2){return N2.find(fn);}var O2=curry(find);function findIndex(fn,Q2){var R2=Q2.length,S2=-1;while(++S2<R2){if(fn(Q2[S2])){return S2;}}return-1;}var T2=curry(findIndex);function flatten(U2,V2){V2=V2===void 0?[]:V2;for(var i=0;i<U2.length;i++){if(Array.isArray(U2[i])){flatten(U2[i],V2);}else{V2.push(U2[i]);}}return V2;}function flipExport(fn){return function(){for(var X2=arguments.length,Y2=Array(X2),Z2=0;Z2<X2;Z2++){Y2[Z2]=arguments[Z2];}if(Y2.length===1){return function(a3){return fn(a3,Y2[0]);};}else if(Y2.length===2){return fn(Y2[1],Y2[0]);}return void 0;};}function flip(fn){return flipExport(fn);}function has(c3,d3){return d3[c3]!==void 0;}var e3=curry(has);function head(a){if(typeof a==='string'){return a[0]||'';}return a[0];}function ifElse(f3,g3,h3){return function(i3){if(f3(i3)===!0){return g3(i3);}return h3(i3);};}var j3=curryThree(ifElse);function isNil(x){return x===void 0||x===null;}function indexOf(x,k3){var l3=-1,m3=k3.length;while(++l3<m3){if(k3[l3]===x){return l3;}}return-1;}var n3=curry(indexOf);function baseSlice(o3,p3,q3){var r3=-1,s3=o3.length;q3=q3>s3?s3:q3;if(q3<0){q3+=s3;}s3=p3>q3?0:q3-p3>>>0;p3>>>=0;var t3=Array(s3);while(++r3<s3){t3[r3]=o3[r3+p3];}return t3;}function init(a){if(typeof a==='string'){return a.slice(0,-1);}return a.length?baseSlice(a,0,-1):[];}function last(a){if(typeof a==='string'){return a[a.length-1]||'';}return a[a.length-1];}function mapObject(fn,v3){var w3={};for(var x3 in v3){w3[x3]=fn(v3[x3]);}return w3;}function map(fn,z3){if(z3.length===void 0){return mapObject(fn,z3);}var A3=-1,B3=z3.length,C3=Array(B3);while(++A3<B3){C3[A3]=fn(z3[A3]);}return C3;}var D3=curry(map);function match(E3,F3){var G3=F3.match(E3);return G3===null?[]:G3;}var H3=curry(match);function merge(I3,J3){return Object.assign({},I3,J3);}var K3=curry(merge);function omit(L3,M3){if(arguments.length===1){return function(N3){return omit(L3,N3);};}if(M3===void 0||M3===null){return void 0;}if(typeof L3==='string'){L3=L3.split(',').map(function(x){return x.trim();});}var O3={};for(var P3 in M3){if(!L3.includes(P3)){O3[P3]=M3[P3];}}return O3;}function partialCurry(fn){var R3=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(S3){if(type(fn)==='Async'||type(fn)==='Promise'){return new Promise(function(T3,U3){fn(K3(S3,R3)).then(T3).catch(U3);});}return fn(K3(S3,R3));};}function path(V3,W3){if(arguments.length===1){return function(X3){return path(V3,X3);};}if(W3===null||W3===void 0){return void 0;}var Y3=W3,Z3=0;if(typeof V3==='string'){V3=V3.split('.');}while(Z3<V3.length){if(Y3===null||Y3===void 0){return void 0;}Y3=Y3[V3[Z3]];Z3++;}return Y3;}function pathOr(a4,b4,c4){return defaultTo(a4,path(b4,c4));}var d4=curry$1(pathOr);function pick(e4,f4){if(arguments.length===1){return function(g4){return pick(e4,g4);};}if(!(type(f4)==='Object')){return void 0;}if(type(e4)==='String'){e4=e4.split(',').map(function(x){return x.trim();});}var h4={},i4=0;while(i4<e4.length){if(e4[i4]in f4){h4[e4[i4]]=f4[e4[i4]];}i4++;}return h4;}function pipe(){for(var j4=arguments.length,k4=Array(j4),l4=0;l4<j4;l4++){k4[l4]=arguments[l4];}return compose.apply(void 0,toConsumableArray(k4.reverse()));}function pluck(m4,n4){var o4=[];D3(function(p4){if(!(p4[m4]===void 0)){o4.push(p4[m4]);}},n4);return o4;}var q4=curry(pluck);function prepend(r4,s4){if(typeof s4==='string'){return''+r4+s4;}var t4=s4.concat();t4.unshift(r4);return t4;}var u4=curry(prepend);function prop(v4,w4){return w4[v4];}var x4=curry(prop);function propEq(y4,z4,A4){return A4[y4]===z4;}var B4=curryThree(propEq);function range(C4,D4){for(var E4=[],i=C4;i<D4;i++){E4.push(i);}return E4;}function reduce(fn,G4,H4){return H4.reduce(fn,G4);}var I4=curryThree(reduce);function repeat(a,J4){var K4=Array(J4);return K4.fill(a);}var L4=curry(repeat);function replace(M4,N4,O4){return O4.replace(M4,N4);}var P4=curryThree(replace);function sort(fn,R4){var S4=R4.concat();return S4.sort(fn);}var T4=curry(sort);function sortBy(fn,V4){var W4=V4.concat();return W4.sort(function(a,b){var X4=fn(a),Y4=fn(b);return X4<Y4?-1:X4>Y4?1:0;});}var Z4=curry(sortBy);function split(a5,b5){return b5.split(a5);}var c5=curry(split);function splitEvery(d5,a){d5=d5>1?d5:1;var e5=[],f5=0;while(f5<a.length){e5.push(a.slice(f5,f5+=d5));}return e5;}var g5=curry(splitEvery);function tap(fn,i5){fn(i5);return i5;}var j5=curry(tap);function tail(k5){return H2(1,k5);}function take(l5,a){if(typeof a==='string'){return a.slice(0,l5);}return baseSlice(a,0,l5);}var m5=curry(take);function takeLast(n5,a){var o5=a.length;n5=n5>o5?o5:n5;if(typeof a==='string'){return a.slice(o5-n5);}n5=o5-n5;return baseSlice(a,n5,o5);}var p5=curry(takeLast);function test(q5,r5){return r5.search(q5)!==-1;}var s5=curry(test);function typedDefaultTo(t5,u5){if(arguments.length===1){return function(v5){return typedDefaultTo(t5,v5);};}return type(u5)!==type(t5)?t5:u5;}function typedPathOr(w5,x5,y5){return typedDefaultTo(w5,path(x5,y5));}var z5=curry$1(typedPathOr);function uniq(A5){var B5=-1,C5=[];while(++B5<A5.length){var D5=A5[B5];if(!A2(D5,C5)){C5.push(D5);}}return C5;}function update(E5,F5,G5){var H5=G5.concat();return H5.fill(F5,E5,E5+1);}var I5=curryThree(update);function values(J5){var K5=[];for(var L5 in J5){K5.push(J5[L5]);}return K5;}var M5=u('+'),always=function always(x){return function(){return x;};},complement=function complement(fn){return function(O5){return!fn(O5);};},P5=oppositeHelper('concat'),Q5=u('/'),R5=helper('endsWith'),F=function F(){return!1;},identity=function identity(x){return x;},S5=helper('includes'),T5=helper('join'),U5=helper('lastIndexOf'),V5=propHelper('length'),W5=u('%'),X5=u('*'),not=function not(x){return!x;},Y5=helper('padEnd'),Z5=helper('padStart'),a6=simpleHelper('reverse'),b6=helper('startsWith'),c6=u('-'),T=function T(){return!0;},d6=simpleHelper('toLowerCase'),e6=simpleHelper('toString'),f6=simpleHelper('toUpperCase'),g6=simpleHelper('trim');e.add=M5;e.always=always;e.complement=complement;e.concat=P5;e.divide=Q5;e.endsWith=R5;e.F=F;e.identity=identity;e.includes=S5;e.join=T5;e.lastIndexOf=U5;e.length=V5;e.modulo=W5;e.multiply=X5;e.not=not;e.padEnd=Y5;e.padStart=Z5;e.reverse=a6;e.startsWith=b6;e.subtract=c6;e.T=T;e.toLower=d6;e.toString=e6;e.toUpper=f6;e.trim=g6;e.addIndex=addIndex;e.adjust=X;e.all=m1;e.allPass=allPass;e.anyPass=anyPass;e.any=q1;e.append=A1;e.both=C1;e.compose=compose;e.contains=A2;e.curry=curry$1;e.dec=dec;e.defaultTo=defaultTo;e.drop=H2;e.dropLast=J2;e.either=L2;e.inc=inc;e.equals=equals;e.filter=j1;e.find=O2;e.findIndex=T2;e.flatten=flatten;e.flip=flip;e.has=e3;e.head=head;e.ifElse=j3;e.isNil=isNil;e.indexOf=n3;e.init=init;e.last=last;e.map=D3;e.match=H3;e.merge=K3;e.omit=omit;e.partialCurry=partialCurry;e.path=path;e.pathOr=d4;e.pick=pick;e.pipe=pipe;e.pluck=q4;e.prepend=u4;e.prop=x4;e.propEq=B4;e.range=range;e.reduce=I4;e.repeat=L4;e.replace=P4;e.sort=T4;e.sortBy=Z4;e.split=c5;e.splitEvery=g5;e.tap=j5;e.tail=tail;e.take=m5;e.takeLast=p5;e.test=s5;e.type=type;e.typedPathOr=z5;e.typedDefaultTo=typedDefaultTo;e.uniq=uniq;e.update=I5;e.values=values;Object.defineProperty(e,'__esModule',{value:!0});}); |
@@ -37,3 +37,3 @@ [![Build Status](https://img.shields.io/travis/selfrefactor/rambda.svg)](https://travis-ci.org/selfrefactor/rambda) | ||
``` | ||
https://cdnjs.cloudflare.com/ajax/libs/rambda/0.9.0/webVersion.js | ||
https://cdnjs.cloudflare.com/ajax/libs/rambda/0.9.2/webVersion.js | ||
``` | ||
@@ -49,2 +49,4 @@ | ||
- Rambda's **flip** works only for functions expecting two arguments. | ||
- Rambda's **partialCurry**, **typedDefaultTo**, **typedPathOr**, **includes**, **padStart** and **padEnd** are not part of Ramda API. | ||
@@ -54,2 +56,4 @@ | ||
- Rambda's **startsWith/endsWith** work only with strings, instead with array and strings. | ||
> If you need more **Ramda** methods in **Rambda**, you may either submit a `PR` or check the extended version of **Rambda** - [Rambdax](https://github.com/selfrefactor/rambdax) | ||
@@ -272,3 +276,3 @@ | ||
> endsWith(x: any, arrOrStr: Array|String): Boolean | ||
> endsWith(x: String, str: String): Boolean | ||
@@ -278,7 +282,7 @@ ``` | ||
'bar', | ||
"foo-bar" | ||
'foo-bar' | ||
) // => true | ||
R.endsWith( | ||
'baz', | ||
'foo', | ||
"foo-bar" | ||
@@ -795,13 +799,13 @@ ) // => false | ||
> startsWith(x: any, arrOrStr: Array|String): Boolean | ||
> startsWith(x: string, str: String): Boolean | ||
``` | ||
R.endsWith( | ||
'bar', | ||
"foo-bar" | ||
R.startsWith( | ||
'foo', | ||
'foo-bar' | ||
) // => true | ||
R.endsWith( | ||
'baz', | ||
"foo-bar" | ||
R.startsWith( | ||
'bar', | ||
'foo-bar' | ||
) // => false | ||
@@ -948,3 +952,3 @@ ``` | ||
- Note that `typedDefaultTo` is method specific for **Rambda** and the method is not part of **Ramda**'s API | ||
- Note that `typedPathOr` is method specific for **Rambda** and the method is not part of **Ramda**'s API | ||
@@ -995,3 +999,3 @@ #### uniq | ||
Note that this method is not part of `Ramda` API. | ||
!! Note that this method is not part of `Ramda` API. | ||
@@ -1004,3 +1008,3 @@ #### padEnd | ||
Note that this method is not part of `Ramda` API. | ||
!! Note that this method is not part of `Ramda` API. | ||
@@ -1013,3 +1017,3 @@ #### padStart | ||
Note that this method is not part of `Ramda` API. | ||
!! Note that this method is not part of `Ramda` API. | ||
@@ -1021,5 +1025,15 @@ ## Benchmark | ||
## Flowtype | ||
## Tree-shaking | ||
I haven't tested it fully, but the partial test shows that [Ramda | ||
![bundlephobia](https://user-images.githubusercontent.com/2149294/30378716-c8e43568-989c-11e7-81ee-aa9ec2c4bff2.png) | ||
## Typings | ||
- Typescript | ||
Rambda's typings are located at `./index.d.ts`, so your IDE should be able to pick it up without any additional actions. | ||
- Flowtype | ||
You can use [Ramda | ||
definitions](https://github.com/flowtype/flow-typed/blob/master/definitions/npm/ramda_v0.21.x/flow_v0.28.x-v0.30.x/ramda_v0.21.x.js) can be used. | ||
@@ -1031,2 +1045,4 @@ | ||
- 0.9.2 Add `Typescript` definitions | ||
- 0.9.1 Close issue [#36](https://github.com/selfrefactor/rambda/issues/36) - move current behaviour of `defaultTo` to a new method `typedDefaultTo`; make `defaultTo` follow Ramda spec; add `pathOr`; add `typedPathOr`. | ||
- 0.9.0 Add `R.pipe` [PR#35](https://github.com/selfrefactor/rambda/pull/35) | ||
@@ -1054,3 +1070,2 @@ - 0.8.9 Add `R.isNil` | ||
### Function | ||
@@ -1386,6 +1401,8 @@ | ||
> Projects using Rambda | ||
> Libraries using Rambda | ||
- [I Learn Smarter](https://github.com/selfrefactor/ils) | ||
- [ig-api](https://www.npmjs.com/package/ig-api) | ||
- [ldap-authenticate](https://www.npmjs.com/package/ldap-authenticate) | ||
- [json-validity](https://www.npmjs.com/package/json-validity) | ||
@@ -1395,4 +1412,2 @@ | ||
- [phobetor](https://github.com/selfrefactor/phobetor) | ||
- [string-fn](https://www.npmjs.com/package/string-fn) | ||
@@ -1399,0 +1414,0 @@ |
import filter from './filter' | ||
import curry from './internal/curry' | ||
export default function all (condition, arr) { | ||
if (arguments.length === 1) { | ||
return arrHolder => all(condition, arrHolder) | ||
} | ||
function all (condition, arr) { | ||
return filter(condition, arr).length === arr.length | ||
} | ||
export default curry(all) |
@@ -8,3 +8,3 @@ import any from './any' | ||
return !any(condition => !condition(x))(conditions) | ||
return !any(condition => !condition(x), conditions) | ||
} |
import curry from './internal/curry' | ||
function append (val, arr) { | ||
if(typeof arr === 'string'){ | ||
return `${arr}${val}` | ||
if (typeof arr === 'string') { | ||
return `${ arr }${ val }` | ||
} | ||
@@ -7,0 +7,0 @@ const clone = arr.concat() |
@@ -7,6 +7,6 @@ import type from './type' | ||
} | ||
return inputArgument === undefined || inputArgument === null || Number.isNaN(inputArgument) === true ? | ||
return inputArgument === undefined || inputArgument === null || Number.isNaN(inputArgument) === true ? | ||
defaultArgument : | ||
inputArgument | ||
} |
@@ -1,5 +0,8 @@ | ||
import curry from './internal/curry' | ||
import type from './type' | ||
function equals (a, b) { | ||
export default function equals (a, b) { | ||
if (arguments.length === 1) { | ||
return bHolder => equals(a, bHolder) | ||
} | ||
if (a === b) { | ||
@@ -57,3 +60,1 @@ return true | ||
} | ||
export default curry(equals) |
export default function isNil (x) { | ||
return x === undefined || x === null | ||
return x === undefined || x === null | ||
} |
import curry from './internal/curry' | ||
function prepend (val, arr) { | ||
if(typeof arr === 'string'){ | ||
return `${val}${arr}` | ||
if (typeof arr === 'string') { | ||
return `${ val }${ arr }` | ||
} | ||
@@ -7,0 +7,0 @@ const clone = arr.concat() |
@@ -8,5 +8,5 @@ import type from './type' | ||
return !(type(inputArgument) === type(defaultArgument)) ? | ||
return type(inputArgument) !== type(defaultArgument) ? | ||
defaultArgument : | ||
inputArgument | ||
} |
{ | ||
"name": "rambda", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "Lightweight alternative to Ramda", | ||
@@ -5,0 +5,0 @@ "main": "dist/rambda.cjs.js", |
@@ -37,3 +37,3 @@ [![Build Status](https://img.shields.io/travis/selfrefactor/rambda.svg)](https://travis-ci.org/selfrefactor/rambda) | ||
``` | ||
https://cdnjs.cloudflare.com/ajax/libs/rambda/0.9.1/webVersion.js | ||
https://cdnjs.cloudflare.com/ajax/libs/rambda/0.9.2/webVersion.js | ||
``` | ||
@@ -49,2 +49,4 @@ | ||
- Rambda's **flip** works only for functions expecting two arguments. | ||
- Rambda's **partialCurry**, **typedDefaultTo**, **typedPathOr**, **includes**, **padStart** and **padEnd** are not part of Ramda API. | ||
@@ -54,2 +56,4 @@ | ||
- Rambda's **startsWith/endsWith** work only with strings, instead with array and strings. | ||
> If you need more **Ramda** methods in **Rambda**, you may either submit a `PR` or check the extended version of **Rambda** - [Rambdax](https://github.com/selfrefactor/rambdax) | ||
@@ -272,3 +276,3 @@ | ||
> endsWith(x: any, arrOrStr: Array|String): Boolean | ||
> endsWith(x: String, str: String): Boolean | ||
@@ -278,7 +282,7 @@ ``` | ||
'bar', | ||
"foo-bar" | ||
'foo-bar' | ||
) // => true | ||
R.endsWith( | ||
'baz', | ||
'foo', | ||
"foo-bar" | ||
@@ -795,13 +799,13 @@ ) // => false | ||
> startsWith(x: any, arrOrStr: Array|String): Boolean | ||
> startsWith(x: string, str: String): Boolean | ||
``` | ||
R.endsWith( | ||
'bar', | ||
"foo-bar" | ||
R.startsWith( | ||
'foo', | ||
'foo-bar' | ||
) // => true | ||
R.endsWith( | ||
'baz', | ||
"foo-bar" | ||
R.startsWith( | ||
'bar', | ||
'foo-bar' | ||
) // => false | ||
@@ -994,3 +998,3 @@ ``` | ||
Note that this method is not part of `Ramda` API. | ||
!! Note that this method is not part of `Ramda` API. | ||
@@ -1003,3 +1007,3 @@ #### padEnd | ||
Note that this method is not part of `Ramda` API. | ||
!! Note that this method is not part of `Ramda` API. | ||
@@ -1012,3 +1016,3 @@ #### padStart | ||
Note that this method is not part of `Ramda` API. | ||
!! Note that this method is not part of `Ramda` API. | ||
@@ -1024,5 +1028,11 @@ ## Benchmark | ||
## Flowtype | ||
## Typings | ||
I haven't tested it fully, but the partial test shows that [Ramda | ||
- Typescript | ||
Rambda's typings are located at `./index.d.ts`, so your IDE should be able to pick it up without any additional actions. | ||
- Flowtype | ||
You can use [Ramda | ||
definitions](https://github.com/flowtype/flow-typed/blob/master/definitions/npm/ramda_v0.21.x/flow_v0.28.x-v0.30.x/ramda_v0.21.x.js) can be used. | ||
@@ -1034,2 +1044,3 @@ | ||
- 0.9.2 Add `Typescript` definitions | ||
- 0.9.1 Close issue [#36](https://github.com/selfrefactor/rambda/issues/36) - move current behaviour of `defaultTo` to a new method `typedDefaultTo`; make `defaultTo` follow Ramda spec; add `pathOr`; add `typedPathOr`. | ||
@@ -1058,3 +1069,2 @@ - 0.9.0 Add `R.pipe` [PR#35](https://github.com/selfrefactor/rambda/pull/35) | ||
### Function | ||
@@ -1390,6 +1400,8 @@ | ||
> Projects using Rambda | ||
> Libraries using Rambda | ||
- [I Learn Smarter](https://github.com/selfrefactor/ils) | ||
- [ig-api](https://www.npmjs.com/package/ig-api) | ||
- [ldap-authenticate](https://www.npmjs.com/package/ldap-authenticate) | ||
- [json-validity](https://www.npmjs.com/package/json-validity) | ||
@@ -1399,4 +1411,2 @@ | ||
- [phobetor](https://github.com/selfrefactor/phobetor) | ||
- [string-fn](https://www.npmjs.com/package/string-fn) | ||
@@ -1403,0 +1413,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1647128
6094
1405
1
212