update
This commit is contained in:
parent
d9becc67b6
commit
9308795b8b
964 changed files with 104265 additions and 16 deletions
20
node_modules/ramda/es/F.js
generated
vendored
Normal file
20
node_modules/ramda/es/F.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* A function that always returns `false`. Any passed in parameters are ignored.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category Function
|
||||
* @sig * -> Boolean
|
||||
* @param {*}
|
||||
* @return {Boolean}
|
||||
* @see R.T
|
||||
* @example
|
||||
*
|
||||
* R.F(); //=> false
|
||||
*/
|
||||
var F = function () {
|
||||
return false;
|
||||
};
|
||||
|
||||
export default F;
|
20
node_modules/ramda/es/T.js
generated
vendored
Normal file
20
node_modules/ramda/es/T.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* A function that always returns `true`. Any passed in parameters are ignored.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category Function
|
||||
* @sig * -> Boolean
|
||||
* @param {*}
|
||||
* @return {Boolean}
|
||||
* @see R.F
|
||||
* @example
|
||||
*
|
||||
* R.T(); //=> true
|
||||
*/
|
||||
var T = function () {
|
||||
return true;
|
||||
};
|
||||
|
||||
export default T;
|
30
node_modules/ramda/es/__.js
generated
vendored
Normal file
30
node_modules/ramda/es/__.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* A special placeholder value used to specify "gaps" within curried functions,
|
||||
* allowing partial application of any combination of arguments, regardless of
|
||||
* their positions.
|
||||
*
|
||||
* If `g` is a curried ternary function and `_` is `R.__`, the following are
|
||||
* equivalent:
|
||||
*
|
||||
* - `g(1, 2, 3)`
|
||||
* - `g(_, 2, 3)(1)`
|
||||
* - `g(_, _, 3)(1)(2)`
|
||||
* - `g(_, _, 3)(1, 2)`
|
||||
* - `g(_, 2, _)(1, 3)`
|
||||
* - `g(_, 2)(1)(3)`
|
||||
* - `g(_, 2)(1, 3)`
|
||||
* - `g(_, 2)(_, 3)(1)`
|
||||
*
|
||||
* @name __
|
||||
* @constant
|
||||
* @memberOf R
|
||||
* @since v0.6.0
|
||||
* @category Function
|
||||
* @example
|
||||
*
|
||||
* const greet = R.replace('{name}', R.__, 'Hello, {name}!');
|
||||
* greet('Alice'); //=> 'Hello, Alice!'
|
||||
*/
|
||||
export default {
|
||||
'@@functional/placeholder': true
|
||||
};
|
26
node_modules/ramda/es/add.js
generated
vendored
Normal file
26
node_modules/ramda/es/add.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Adds two values.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Math
|
||||
* @sig Number -> Number -> Number
|
||||
* @param {Number} a
|
||||
* @param {Number} b
|
||||
* @return {Number}
|
||||
* @see R.subtract
|
||||
* @example
|
||||
*
|
||||
* R.add(2, 3); //=> 5
|
||||
* R.add(7)(10); //=> 17
|
||||
*/
|
||||
|
||||
var add =
|
||||
/*#__PURE__*/
|
||||
_curry2(function add(a, b) {
|
||||
return Number(a) + Number(b);
|
||||
});
|
||||
|
||||
export default add;
|
48
node_modules/ramda/es/addIndex.js
generated
vendored
Normal file
48
node_modules/ramda/es/addIndex.js
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
import _concat from "./internal/_concat.js";
|
||||
import _curry1 from "./internal/_curry1.js";
|
||||
import curryN from "./curryN.js";
|
||||
/**
|
||||
* Creates a new list iteration function from an existing one by adding two new
|
||||
* parameters to its callback function: the current index, and the entire list.
|
||||
*
|
||||
* This would turn, for instance, [`R.map`](#map) function into one that
|
||||
* more closely resembles `Array.prototype.map`. Note that this will only work
|
||||
* for functions in which the iteration callback function is the first
|
||||
* parameter, and where the list is the last parameter. (This latter might be
|
||||
* unimportant if the list parameter is not used.)
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.15.0
|
||||
* @category Function
|
||||
* @category List
|
||||
* @sig ((a ... -> b) ... -> [a] -> *) -> ((a ..., Int, [a] -> b) ... -> [a] -> *)
|
||||
* @param {Function} fn A list iteration function that does not pass index or list to its callback
|
||||
* @return {Function} An altered list iteration function that passes (item, index, list) to its callback
|
||||
* @example
|
||||
*
|
||||
* const mapIndexed = R.addIndex(R.map);
|
||||
* mapIndexed((val, idx) => idx + '-' + val, ['f', 'o', 'o', 'b', 'a', 'r']);
|
||||
* //=> ['0-f', '1-o', '2-o', '3-b', '4-a', '5-r']
|
||||
*/
|
||||
|
||||
var addIndex =
|
||||
/*#__PURE__*/
|
||||
_curry1(function addIndex(fn) {
|
||||
return curryN(fn.length, function () {
|
||||
var idx = 0;
|
||||
var origFn = arguments[0];
|
||||
var list = arguments[arguments.length - 1];
|
||||
var args = Array.prototype.slice.call(arguments, 0);
|
||||
|
||||
args[0] = function () {
|
||||
var result = origFn.apply(this, _concat(arguments, [idx, list]));
|
||||
idx += 1;
|
||||
return result;
|
||||
};
|
||||
|
||||
return fn.apply(this, args);
|
||||
});
|
||||
});
|
||||
|
||||
export default addIndex;
|
46
node_modules/ramda/es/adjust.js
generated
vendored
Normal file
46
node_modules/ramda/es/adjust.js
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
import _concat from "./internal/_concat.js";
|
||||
import _curry3 from "./internal/_curry3.js";
|
||||
/**
|
||||
* Applies a function to the value at the given index of an array, returning a
|
||||
* new copy of the array with the element at the given index replaced with the
|
||||
* result of the function application.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.14.0
|
||||
* @category List
|
||||
* @sig Number -> (a -> a) -> [a] -> [a]
|
||||
* @param {Number} idx The index.
|
||||
* @param {Function} fn The function to apply.
|
||||
* @param {Array|Arguments} list An array-like object whose value
|
||||
* at the supplied index will be replaced.
|
||||
* @return {Array} A copy of the supplied array-like object with
|
||||
* the element at index `idx` replaced with the value
|
||||
* returned by applying `fn` to the existing element.
|
||||
* @see R.update
|
||||
* @example
|
||||
*
|
||||
* R.adjust(1, R.toUpper, ['a', 'b', 'c', 'd']); //=> ['a', 'B', 'c', 'd']
|
||||
* R.adjust(-1, R.toUpper, ['a', 'b', 'c', 'd']); //=> ['a', 'b', 'c', 'D']
|
||||
* @symb R.adjust(-1, f, [a, b]) = [a, f(b)]
|
||||
* @symb R.adjust(0, f, [a, b]) = [f(a), b]
|
||||
*/
|
||||
|
||||
var adjust =
|
||||
/*#__PURE__*/
|
||||
_curry3(function adjust(idx, fn, list) {
|
||||
if (idx >= list.length || idx < -list.length) {
|
||||
return list;
|
||||
}
|
||||
|
||||
var start = idx < 0 ? list.length : 0;
|
||||
|
||||
var _idx = start + idx;
|
||||
|
||||
var _list = _concat(list);
|
||||
|
||||
_list[_idx] = fn(list[_idx]);
|
||||
return _list;
|
||||
});
|
||||
|
||||
export default adjust;
|
47
node_modules/ramda/es/all.js
generated
vendored
Normal file
47
node_modules/ramda/es/all.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xall from "./internal/_xall.js";
|
||||
/**
|
||||
* Returns `true` if all elements of the list match the predicate, `false` if
|
||||
* there are any that don't.
|
||||
*
|
||||
* Dispatches to the `all` method of the second argument, if present.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig (a -> Boolean) -> [a] -> Boolean
|
||||
* @param {Function} fn The predicate function.
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Boolean} `true` if the predicate is satisfied by every element, `false`
|
||||
* otherwise.
|
||||
* @see R.any, R.none, R.transduce
|
||||
* @example
|
||||
*
|
||||
* const equals3 = R.equals(3);
|
||||
* R.all(equals3)([3, 3, 3, 3]); //=> true
|
||||
* R.all(equals3)([3, 3, 1, 3]); //=> false
|
||||
*/
|
||||
|
||||
var all =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable(['all'], _xall, function all(fn, list) {
|
||||
var idx = 0;
|
||||
|
||||
while (idx < list.length) {
|
||||
if (!fn(list[idx])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return true;
|
||||
}));
|
||||
|
||||
export default all;
|
51
node_modules/ramda/es/allPass.js
generated
vendored
Normal file
51
node_modules/ramda/es/allPass.js
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import curryN from "./curryN.js";
|
||||
import max from "./max.js";
|
||||
import pluck from "./pluck.js";
|
||||
import reduce from "./reduce.js";
|
||||
/**
|
||||
* Takes a list of predicates and returns a predicate that returns true for a
|
||||
* given list of arguments if every one of the provided predicates is satisfied
|
||||
* by those arguments.
|
||||
*
|
||||
* The function returned is a curried function whose arity matches that of the
|
||||
* highest-arity predicate.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category Logic
|
||||
* @sig [(*... -> Boolean)] -> (*... -> Boolean)
|
||||
* @param {Array} predicates An array of predicates to check
|
||||
* @return {Function} The combined predicate
|
||||
* @see R.anyPass
|
||||
* @example
|
||||
*
|
||||
* const isQueen = R.propEq('rank', 'Q');
|
||||
* const isSpade = R.propEq('suit', '♠︎');
|
||||
* const isQueenOfSpades = R.allPass([isQueen, isSpade]);
|
||||
*
|
||||
* isQueenOfSpades({rank: 'Q', suit: '♣︎'}); //=> false
|
||||
* isQueenOfSpades({rank: 'Q', suit: '♠︎'}); //=> true
|
||||
*/
|
||||
|
||||
var allPass =
|
||||
/*#__PURE__*/
|
||||
_curry1(function allPass(preds) {
|
||||
return curryN(reduce(max, 0, pluck('length', preds)), function () {
|
||||
var idx = 0;
|
||||
var len = preds.length;
|
||||
|
||||
while (idx < len) {
|
||||
if (!preds[idx].apply(this, arguments)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
export default allPass;
|
30
node_modules/ramda/es/always.js
generated
vendored
Normal file
30
node_modules/ramda/es/always.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
/**
|
||||
* Returns a function that always returns the given value. Note that for
|
||||
* non-primitives the value returned is a reference to the original value.
|
||||
*
|
||||
* This function is known as `const`, `constant`, or `K` (for K combinator) in
|
||||
* other languages and libraries.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Function
|
||||
* @sig a -> (* -> a)
|
||||
* @param {*} val The value to wrap in a function
|
||||
* @return {Function} A Function :: * -> val.
|
||||
* @example
|
||||
*
|
||||
* const t = R.always('Tee');
|
||||
* t(); //=> 'Tee'
|
||||
*/
|
||||
|
||||
var always =
|
||||
/*#__PURE__*/
|
||||
_curry1(function always(val) {
|
||||
return function () {
|
||||
return val;
|
||||
};
|
||||
});
|
||||
|
||||
export default always;
|
28
node_modules/ramda/es/and.js
generated
vendored
Normal file
28
node_modules/ramda/es/and.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Returns `true` if both arguments are `true`; `false` otherwise.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Logic
|
||||
* @sig a -> b -> a | b
|
||||
* @param {Any} a
|
||||
* @param {Any} b
|
||||
* @return {Any} the first argument if it is falsy, otherwise the second argument.
|
||||
* @see R.both, R.xor
|
||||
* @example
|
||||
*
|
||||
* R.and(true, true); //=> true
|
||||
* R.and(true, false); //=> false
|
||||
* R.and(false, true); //=> false
|
||||
* R.and(false, false); //=> false
|
||||
*/
|
||||
|
||||
var and =
|
||||
/*#__PURE__*/
|
||||
_curry2(function and(a, b) {
|
||||
return a && b;
|
||||
});
|
||||
|
||||
export default and;
|
38
node_modules/ramda/es/andThen.js
generated
vendored
Normal file
38
node_modules/ramda/es/andThen.js
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _assertPromise from "./internal/_assertPromise.js";
|
||||
/**
|
||||
* Returns the result of applying the onSuccess function to the value inside
|
||||
* a successfully resolved promise. This is useful for working with promises
|
||||
* inside function compositions.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.27.0
|
||||
* @category Function
|
||||
* @sig (a -> b) -> (Promise e a) -> (Promise e b)
|
||||
* @sig (a -> (Promise e b)) -> (Promise e a) -> (Promise e b)
|
||||
* @param {Function} onSuccess The function to apply. Can return a value or a promise of a value.
|
||||
* @param {Promise} p
|
||||
* @return {Promise} The result of calling `p.then(onSuccess)`
|
||||
* @see R.otherwise
|
||||
* @example
|
||||
*
|
||||
* var makeQuery = (email) => ({ query: { email }});
|
||||
*
|
||||
* //getMemberName :: String -> Promise ({firstName, lastName})
|
||||
* var getMemberName = R.pipe(
|
||||
* makeQuery,
|
||||
* fetchMember,
|
||||
* R.andThen(R.pick(['firstName', 'lastName']))
|
||||
* );
|
||||
*/
|
||||
|
||||
var andThen =
|
||||
/*#__PURE__*/
|
||||
_curry2(function andThen(f, p) {
|
||||
_assertPromise('andThen', p);
|
||||
|
||||
return p.then(f);
|
||||
});
|
||||
|
||||
export default andThen;
|
48
node_modules/ramda/es/any.js
generated
vendored
Normal file
48
node_modules/ramda/es/any.js
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xany from "./internal/_xany.js";
|
||||
/**
|
||||
* Returns `true` if at least one of the elements of the list match the predicate,
|
||||
* `false` otherwise.
|
||||
*
|
||||
* Dispatches to the `any` method of the second argument, if present.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig (a -> Boolean) -> [a] -> Boolean
|
||||
* @param {Function} fn The predicate function.
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Boolean} `true` if the predicate is satisfied by at least one element, `false`
|
||||
* otherwise.
|
||||
* @see R.all, R.none, R.transduce
|
||||
* @example
|
||||
*
|
||||
* const lessThan0 = R.flip(R.lt)(0);
|
||||
* const lessThan2 = R.flip(R.lt)(2);
|
||||
* R.any(lessThan0)([1, 2]); //=> false
|
||||
* R.any(lessThan2)([1, 2]); //=> true
|
||||
*/
|
||||
|
||||
var any =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable(['any'], _xany, function any(fn, list) {
|
||||
var idx = 0;
|
||||
|
||||
while (idx < list.length) {
|
||||
if (fn(list[idx])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}));
|
||||
|
||||
export default any;
|
52
node_modules/ramda/es/anyPass.js
generated
vendored
Normal file
52
node_modules/ramda/es/anyPass.js
generated
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import curryN from "./curryN.js";
|
||||
import max from "./max.js";
|
||||
import pluck from "./pluck.js";
|
||||
import reduce from "./reduce.js";
|
||||
/**
|
||||
* Takes a list of predicates and returns a predicate that returns true for a
|
||||
* given list of arguments if at least one of the provided predicates is
|
||||
* satisfied by those arguments.
|
||||
*
|
||||
* The function returned is a curried function whose arity matches that of the
|
||||
* highest-arity predicate.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category Logic
|
||||
* @sig [(*... -> Boolean)] -> (*... -> Boolean)
|
||||
* @param {Array} predicates An array of predicates to check
|
||||
* @return {Function} The combined predicate
|
||||
* @see R.allPass
|
||||
* @example
|
||||
*
|
||||
* const isClub = R.propEq('suit', '♣');
|
||||
* const isSpade = R.propEq('suit', '♠');
|
||||
* const isBlackCard = R.anyPass([isClub, isSpade]);
|
||||
*
|
||||
* isBlackCard({rank: '10', suit: '♣'}); //=> true
|
||||
* isBlackCard({rank: 'Q', suit: '♠'}); //=> true
|
||||
* isBlackCard({rank: 'Q', suit: '♦'}); //=> false
|
||||
*/
|
||||
|
||||
var anyPass =
|
||||
/*#__PURE__*/
|
||||
_curry1(function anyPass(preds) {
|
||||
return curryN(reduce(max, 0, pluck('length', preds)), function () {
|
||||
var idx = 0;
|
||||
var len = preds.length;
|
||||
|
||||
while (idx < len) {
|
||||
if (preds[idx].apply(this, arguments)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
export default anyPass;
|
42
node_modules/ramda/es/ap.js
generated
vendored
Normal file
42
node_modules/ramda/es/ap.js
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
import _concat from "./internal/_concat.js";
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
import _reduce from "./internal/_reduce.js";
|
||||
import map from "./map.js";
|
||||
/**
|
||||
* ap applies a list of functions to a list of values.
|
||||
*
|
||||
* Dispatches to the `ap` method of the second argument, if present. Also
|
||||
* treats curried functions as applicatives.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.3.0
|
||||
* @category Function
|
||||
* @sig [a -> b] -> [a] -> [b]
|
||||
* @sig Apply f => f (a -> b) -> f a -> f b
|
||||
* @sig (r -> a -> b) -> (r -> a) -> (r -> b)
|
||||
* @param {*} applyF
|
||||
* @param {*} applyX
|
||||
* @return {*}
|
||||
* @example
|
||||
*
|
||||
* R.ap([R.multiply(2), R.add(3)], [1,2,3]); //=> [2, 4, 6, 4, 5, 6]
|
||||
* R.ap([R.concat('tasty '), R.toUpper], ['pizza', 'salad']); //=> ["tasty pizza", "tasty salad", "PIZZA", "SALAD"]
|
||||
*
|
||||
* // R.ap can also be used as S combinator
|
||||
* // when only two functions are passed
|
||||
* R.ap(R.concat, R.toUpper)('Ramda') //=> 'RamdaRAMDA'
|
||||
* @symb R.ap([f, g], [a, b]) = [f(a), f(b), g(a), g(b)]
|
||||
*/
|
||||
|
||||
var ap =
|
||||
/*#__PURE__*/
|
||||
_curry2(function ap(applyF, applyX) {
|
||||
return typeof applyX['fantasy-land/ap'] === 'function' ? applyX['fantasy-land/ap'](applyF) : typeof applyF.ap === 'function' ? applyF.ap(applyX) : typeof applyF === 'function' ? function (x) {
|
||||
return applyF(x)(applyX(x));
|
||||
} : _reduce(function (acc, f) {
|
||||
return _concat(acc, map(f, applyX));
|
||||
}, [], applyF);
|
||||
});
|
||||
|
||||
export default ap;
|
33
node_modules/ramda/es/aperture.js
generated
vendored
Normal file
33
node_modules/ramda/es/aperture.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
import _aperture from "./internal/_aperture.js";
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xaperture from "./internal/_xaperture.js";
|
||||
/**
|
||||
* Returns a new list, composed of n-tuples of consecutive elements. If `n` is
|
||||
* greater than the length of the list, an empty list is returned.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.12.0
|
||||
* @category List
|
||||
* @sig Number -> [a] -> [[a]]
|
||||
* @param {Number} n The size of the tuples to create
|
||||
* @param {Array} list The list to split into `n`-length tuples
|
||||
* @return {Array} The resulting list of `n`-length tuples
|
||||
* @see R.transduce
|
||||
* @example
|
||||
*
|
||||
* R.aperture(2, [1, 2, 3, 4, 5]); //=> [[1, 2], [2, 3], [3, 4], [4, 5]]
|
||||
* R.aperture(3, [1, 2, 3, 4, 5]); //=> [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
|
||||
* R.aperture(7, [1, 2, 3, 4, 5]); //=> []
|
||||
*/
|
||||
|
||||
var aperture =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable([], _xaperture, _aperture));
|
||||
|
||||
export default aperture;
|
30
node_modules/ramda/es/append.js
generated
vendored
Normal file
30
node_modules/ramda/es/append.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
import _concat from "./internal/_concat.js";
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Returns a new list containing the contents of the given list, followed by
|
||||
* the given element.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig a -> [a] -> [a]
|
||||
* @param {*} el The element to add to the end of the new list.
|
||||
* @param {Array} list The list of elements to add a new item to.
|
||||
* list.
|
||||
* @return {Array} A new list containing the elements of the old list followed by `el`.
|
||||
* @see R.prepend
|
||||
* @example
|
||||
*
|
||||
* R.append('tests', ['write', 'more']); //=> ['write', 'more', 'tests']
|
||||
* R.append('tests', []); //=> ['tests']
|
||||
* R.append(['tests'], ['write', 'more']); //=> ['write', 'more', ['tests']]
|
||||
*/
|
||||
|
||||
var append =
|
||||
/*#__PURE__*/
|
||||
_curry2(function append(el, list) {
|
||||
return _concat(list, [el]);
|
||||
});
|
||||
|
||||
export default append;
|
29
node_modules/ramda/es/apply.js
generated
vendored
Normal file
29
node_modules/ramda/es/apply.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Applies function `fn` to the argument list `args`. This is useful for
|
||||
* creating a fixed-arity function from a variadic function. `fn` should be a
|
||||
* bound function if context is significant.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.7.0
|
||||
* @category Function
|
||||
* @sig (*... -> a) -> [*] -> a
|
||||
* @param {Function} fn The function which will be called with `args`
|
||||
* @param {Array} args The arguments to call `fn` with
|
||||
* @return {*} result The result, equivalent to `fn(...args)`
|
||||
* @see R.call, R.unapply
|
||||
* @example
|
||||
*
|
||||
* const nums = [1, 2, 3, -99, 42, 6, 7];
|
||||
* R.apply(Math.max, nums); //=> 42
|
||||
* @symb R.apply(f, [a, b, c]) = f(a, b, c)
|
||||
*/
|
||||
|
||||
var apply =
|
||||
/*#__PURE__*/
|
||||
_curry2(function apply(fn, args) {
|
||||
return fn.apply(this, args);
|
||||
});
|
||||
|
||||
export default apply;
|
58
node_modules/ramda/es/applySpec.js
generated
vendored
Normal file
58
node_modules/ramda/es/applySpec.js
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import apply from "./apply.js";
|
||||
import curryN from "./curryN.js";
|
||||
import max from "./max.js";
|
||||
import pluck from "./pluck.js";
|
||||
import reduce from "./reduce.js";
|
||||
import keys from "./keys.js";
|
||||
import values from "./values.js"; // Use custom mapValues function to avoid issues with specs that include a "map" key and R.map
|
||||
// delegating calls to .map
|
||||
|
||||
function mapValues(fn, obj) {
|
||||
return keys(obj).reduce(function (acc, key) {
|
||||
acc[key] = fn(obj[key]);
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
/**
|
||||
* Given a spec object recursively mapping properties to functions, creates a
|
||||
* function producing an object of the same structure, by mapping each property
|
||||
* to the result of calling its associated function with the supplied arguments.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.20.0
|
||||
* @category Function
|
||||
* @sig {k: ((a, b, ..., m) -> v)} -> ((a, b, ..., m) -> {k: v})
|
||||
* @param {Object} spec an object recursively mapping properties to functions for
|
||||
* producing the values for these properties.
|
||||
* @return {Function} A function that returns an object of the same structure
|
||||
* as `spec', with each property set to the value returned by calling its
|
||||
* associated function with the supplied arguments.
|
||||
* @see R.converge, R.juxt
|
||||
* @example
|
||||
*
|
||||
* const getMetrics = R.applySpec({
|
||||
* sum: R.add,
|
||||
* nested: { mul: R.multiply }
|
||||
* });
|
||||
* getMetrics(2, 4); // => { sum: 6, nested: { mul: 8 } }
|
||||
* @symb R.applySpec({ x: f, y: { z: g } })(a, b) = { x: f(a, b), y: { z: g(a, b) } }
|
||||
*/
|
||||
|
||||
|
||||
var applySpec =
|
||||
/*#__PURE__*/
|
||||
_curry1(function applySpec(spec) {
|
||||
spec = mapValues(function (v) {
|
||||
return typeof v == 'function' ? v : applySpec(v);
|
||||
}, spec);
|
||||
return curryN(reduce(max, 0, pluck('length', values(spec))), function () {
|
||||
var args = arguments;
|
||||
return mapValues(function (f) {
|
||||
return apply(f, args);
|
||||
}, spec);
|
||||
});
|
||||
});
|
||||
|
||||
export default applySpec;
|
28
node_modules/ramda/es/applyTo.js
generated
vendored
Normal file
28
node_modules/ramda/es/applyTo.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Takes a value and applies a function to it.
|
||||
*
|
||||
* This function is also known as the `thrush` combinator.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.25.0
|
||||
* @category Function
|
||||
* @sig a -> (a -> b) -> b
|
||||
* @param {*} x The value
|
||||
* @param {Function} f The function to apply
|
||||
* @return {*} The result of applying `f` to `x`
|
||||
* @example
|
||||
*
|
||||
* const t42 = R.applyTo(42);
|
||||
* t42(R.identity); //=> 42
|
||||
* t42(R.add(1)); //=> 43
|
||||
*/
|
||||
|
||||
var applyTo =
|
||||
/*#__PURE__*/
|
||||
_curry2(function applyTo(x, f) {
|
||||
return f(x);
|
||||
});
|
||||
|
||||
export default applyTo;
|
36
node_modules/ramda/es/ascend.js
generated
vendored
Normal file
36
node_modules/ramda/es/ascend.js
generated
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
import _curry3 from "./internal/_curry3.js";
|
||||
/**
|
||||
* Makes an ascending comparator function out of a function that returns a value
|
||||
* that can be compared with `<` and `>`.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.23.0
|
||||
* @category Function
|
||||
* @sig Ord b => (a -> b) -> a -> a -> Number
|
||||
* @param {Function} fn A function of arity one that returns a value that can be compared
|
||||
* @param {*} a The first item to be compared.
|
||||
* @param {*} b The second item to be compared.
|
||||
* @return {Number} `-1` if fn(a) < fn(b), `1` if fn(b) < fn(a), otherwise `0`
|
||||
* @see R.descend
|
||||
* @example
|
||||
*
|
||||
* const byAge = R.ascend(R.prop('age'));
|
||||
* const people = [
|
||||
* { name: 'Emma', age: 70 },
|
||||
* { name: 'Peter', age: 78 },
|
||||
* { name: 'Mikhail', age: 62 },
|
||||
* ];
|
||||
* const peopleByYoungestFirst = R.sort(byAge, people);
|
||||
* //=> [{ name: 'Mikhail', age: 62 },{ name: 'Emma', age: 70 }, { name: 'Peter', age: 78 }]
|
||||
*/
|
||||
|
||||
var ascend =
|
||||
/*#__PURE__*/
|
||||
_curry3(function ascend(fn, a, b) {
|
||||
var aa = fn(a);
|
||||
var bb = fn(b);
|
||||
return aa < bb ? -1 : aa > bb ? 1 : 0;
|
||||
});
|
||||
|
||||
export default ascend;
|
36
node_modules/ramda/es/assoc.js
generated
vendored
Normal file
36
node_modules/ramda/es/assoc.js
generated
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
import _curry3 from "./internal/_curry3.js";
|
||||
/**
|
||||
* Makes a shallow clone of an object, setting or overriding the specified
|
||||
* property with the given value. Note that this copies and flattens prototype
|
||||
* properties onto the new object as well. All non-primitive properties are
|
||||
* copied by reference.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.8.0
|
||||
* @category Object
|
||||
* @sig String -> a -> {k: v} -> {k: v}
|
||||
* @param {String} prop The property name to set
|
||||
* @param {*} val The new value
|
||||
* @param {Object} obj The object to clone
|
||||
* @return {Object} A new object equivalent to the original except for the changed property.
|
||||
* @see R.dissoc, R.pick
|
||||
* @example
|
||||
*
|
||||
* R.assoc('c', 3, {a: 1, b: 2}); //=> {a: 1, b: 2, c: 3}
|
||||
*/
|
||||
|
||||
var assoc =
|
||||
/*#__PURE__*/
|
||||
_curry3(function assoc(prop, val, obj) {
|
||||
var result = {};
|
||||
|
||||
for (var p in obj) {
|
||||
result[p] = obj[p];
|
||||
}
|
||||
|
||||
result[prop] = val;
|
||||
return result;
|
||||
});
|
||||
|
||||
export default assoc;
|
55
node_modules/ramda/es/assocPath.js
generated
vendored
Normal file
55
node_modules/ramda/es/assocPath.js
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
import _curry3 from "./internal/_curry3.js";
|
||||
import _has from "./internal/_has.js";
|
||||
import _isArray from "./internal/_isArray.js";
|
||||
import _isInteger from "./internal/_isInteger.js";
|
||||
import assoc from "./assoc.js";
|
||||
import isNil from "./isNil.js";
|
||||
/**
|
||||
* Makes a shallow clone of an object, setting or overriding the nodes required
|
||||
* to create the given path, and placing the specific value at the tail end of
|
||||
* that path. Note that this copies and flattens prototype properties onto the
|
||||
* new object as well. All non-primitive properties are copied by reference.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.8.0
|
||||
* @category Object
|
||||
* @typedefn Idx = String | Int
|
||||
* @sig [Idx] -> a -> {a} -> {a}
|
||||
* @param {Array} path the path to set
|
||||
* @param {*} val The new value
|
||||
* @param {Object} obj The object to clone
|
||||
* @return {Object} A new object equivalent to the original except along the specified path.
|
||||
* @see R.dissocPath
|
||||
* @example
|
||||
*
|
||||
* R.assocPath(['a', 'b', 'c'], 42, {a: {b: {c: 0}}}); //=> {a: {b: {c: 42}}}
|
||||
*
|
||||
* // Any missing or non-object keys in path will be overridden
|
||||
* R.assocPath(['a', 'b', 'c'], 42, {a: 5}); //=> {a: {b: {c: 42}}}
|
||||
*/
|
||||
|
||||
var assocPath =
|
||||
/*#__PURE__*/
|
||||
_curry3(function assocPath(path, val, obj) {
|
||||
if (path.length === 0) {
|
||||
return val;
|
||||
}
|
||||
|
||||
var idx = path[0];
|
||||
|
||||
if (path.length > 1) {
|
||||
var nextObj = !isNil(obj) && _has(idx, obj) ? obj[idx] : _isInteger(path[1]) ? [] : {};
|
||||
val = assocPath(Array.prototype.slice.call(path, 1), val, nextObj);
|
||||
}
|
||||
|
||||
if (_isInteger(idx) && _isArray(obj)) {
|
||||
var arr = [].concat(obj);
|
||||
arr[idx] = val;
|
||||
return arr;
|
||||
} else {
|
||||
return assoc(idx, val, obj);
|
||||
}
|
||||
});
|
||||
|
||||
export default assocPath;
|
38
node_modules/ramda/es/binary.js
generated
vendored
Normal file
38
node_modules/ramda/es/binary.js
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import nAry from "./nAry.js";
|
||||
/**
|
||||
* Wraps a function of any arity (including nullary) in a function that accepts
|
||||
* exactly 2 parameters. Any extraneous parameters will not be passed to the
|
||||
* supplied function.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.2.0
|
||||
* @category Function
|
||||
* @sig (* -> c) -> (a, b -> c)
|
||||
* @param {Function} fn The function to wrap.
|
||||
* @return {Function} A new function wrapping `fn`. The new function is guaranteed to be of
|
||||
* arity 2.
|
||||
* @see R.nAry, R.unary
|
||||
* @example
|
||||
*
|
||||
* const takesThreeArgs = function(a, b, c) {
|
||||
* return [a, b, c];
|
||||
* };
|
||||
* takesThreeArgs.length; //=> 3
|
||||
* takesThreeArgs(1, 2, 3); //=> [1, 2, 3]
|
||||
*
|
||||
* const takesTwoArgs = R.binary(takesThreeArgs);
|
||||
* takesTwoArgs.length; //=> 2
|
||||
* // Only 2 arguments are passed to the wrapped function
|
||||
* takesTwoArgs(1, 2, 3); //=> [1, 2, undefined]
|
||||
* @symb R.binary(f)(a, b, c) = f(a, b)
|
||||
*/
|
||||
|
||||
var binary =
|
||||
/*#__PURE__*/
|
||||
_curry1(function binary(fn) {
|
||||
return nAry(2, fn);
|
||||
});
|
||||
|
||||
export default binary;
|
34
node_modules/ramda/es/bind.js
generated
vendored
Normal file
34
node_modules/ramda/es/bind.js
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
import _arity from "./internal/_arity.js";
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Creates a function that is bound to a context.
|
||||
* Note: `R.bind` does not provide the additional argument-binding capabilities of
|
||||
* [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.6.0
|
||||
* @category Function
|
||||
* @category Object
|
||||
* @sig (* -> *) -> {*} -> (* -> *)
|
||||
* @param {Function} fn The function to bind to context
|
||||
* @param {Object} thisObj The context to bind `fn` to
|
||||
* @return {Function} A function that will execute in the context of `thisObj`.
|
||||
* @see R.partial
|
||||
* @example
|
||||
*
|
||||
* const log = R.bind(console.log, console);
|
||||
* R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}
|
||||
* // logs {a: 2}
|
||||
* @symb R.bind(f, o)(a, b) = f.call(o, a, b)
|
||||
*/
|
||||
|
||||
var bind =
|
||||
/*#__PURE__*/
|
||||
_curry2(function bind(fn, thisObj) {
|
||||
return _arity(fn.length, function () {
|
||||
return fn.apply(thisObj, arguments);
|
||||
});
|
||||
});
|
||||
|
||||
export default bind;
|
45
node_modules/ramda/es/both.js
generated
vendored
Normal file
45
node_modules/ramda/es/both.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _isFunction from "./internal/_isFunction.js";
|
||||
import and from "./and.js";
|
||||
import lift from "./lift.js";
|
||||
/**
|
||||
* A function which calls the two provided functions and returns the `&&`
|
||||
* of the results.
|
||||
* It returns the result of the first function if it is false-y and the result
|
||||
* of the second function otherwise. Note that this is short-circuited,
|
||||
* meaning that the second function will not be invoked if the first returns a
|
||||
* false-y value.
|
||||
*
|
||||
* In addition to functions, `R.both` also accepts any fantasy-land compatible
|
||||
* applicative functor.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.12.0
|
||||
* @category Logic
|
||||
* @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)
|
||||
* @param {Function} f A predicate
|
||||
* @param {Function} g Another predicate
|
||||
* @return {Function} a function that applies its arguments to `f` and `g` and `&&`s their outputs together.
|
||||
* @see R.and
|
||||
* @example
|
||||
*
|
||||
* const gt10 = R.gt(R.__, 10)
|
||||
* const lt20 = R.lt(R.__, 20)
|
||||
* const f = R.both(gt10, lt20);
|
||||
* f(15); //=> true
|
||||
* f(30); //=> false
|
||||
*
|
||||
* R.both(Maybe.Just(false), Maybe.Just(55)); // => Maybe.Just(false)
|
||||
* R.both([false, false, 'a'], [11]); //=> [false, false, 11]
|
||||
*/
|
||||
|
||||
var both =
|
||||
/*#__PURE__*/
|
||||
_curry2(function both(f, g) {
|
||||
return _isFunction(f) ? function _both() {
|
||||
return f.apply(this, arguments) && g.apply(this, arguments);
|
||||
} : lift(and)(f, g);
|
||||
});
|
||||
|
||||
export default both;
|
40
node_modules/ramda/es/call.js
generated
vendored
Normal file
40
node_modules/ramda/es/call.js
generated
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
import curry from "./curry.js";
|
||||
/**
|
||||
* Returns the result of calling its first argument with the remaining
|
||||
* arguments. This is occasionally useful as a converging function for
|
||||
* [`R.converge`](#converge): the first branch can produce a function while the
|
||||
* remaining branches produce values to be passed to that function as its
|
||||
* arguments.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category Function
|
||||
* @sig (*... -> a),*... -> a
|
||||
* @param {Function} fn The function to apply to the remaining arguments.
|
||||
* @param {...*} args Any number of positional arguments.
|
||||
* @return {*}
|
||||
* @see R.apply
|
||||
* @example
|
||||
*
|
||||
* R.call(R.add, 1, 2); //=> 3
|
||||
*
|
||||
* const indentN = R.pipe(R.repeat(' '),
|
||||
* R.join(''),
|
||||
* R.replace(/^(?!$)/gm));
|
||||
*
|
||||
* const format = R.converge(R.call, [
|
||||
* R.pipe(R.prop('indent'), indentN),
|
||||
* R.prop('value')
|
||||
* ]);
|
||||
*
|
||||
* format({indent: 2, value: 'foo\nbar\nbaz\n'}); //=> ' foo\n bar\n baz\n'
|
||||
* @symb R.call(f, a, b) = f(a, b)
|
||||
*/
|
||||
|
||||
var call =
|
||||
/*#__PURE__*/
|
||||
curry(function call(fn) {
|
||||
return fn.apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
});
|
||||
export default call;
|
47
node_modules/ramda/es/chain.js
generated
vendored
Normal file
47
node_modules/ramda/es/chain.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _makeFlat from "./internal/_makeFlat.js";
|
||||
import _xchain from "./internal/_xchain.js";
|
||||
import map from "./map.js";
|
||||
/**
|
||||
* `chain` maps a function over a list and concatenates the results. `chain`
|
||||
* is also known as `flatMap` in some libraries.
|
||||
*
|
||||
* Dispatches to the `chain` method of the second argument, if present,
|
||||
* according to the [FantasyLand Chain spec](https://github.com/fantasyland/fantasy-land#chain).
|
||||
*
|
||||
* If second argument is a function, `chain(f, g)(x)` is equivalent to `f(g(x), x)`.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.3.0
|
||||
* @category List
|
||||
* @sig Chain m => (a -> m b) -> m a -> m b
|
||||
* @param {Function} fn The function to map with
|
||||
* @param {Array} list The list to map over
|
||||
* @return {Array} The result of flat-mapping `list` with `fn`
|
||||
* @example
|
||||
*
|
||||
* const duplicate = n => [n, n];
|
||||
* R.chain(duplicate, [1, 2, 3]); //=> [1, 1, 2, 2, 3, 3]
|
||||
*
|
||||
* R.chain(R.append, R.head)([1, 2, 3]); //=> [1, 2, 3, 1]
|
||||
*/
|
||||
|
||||
var chain =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable(['fantasy-land/chain', 'chain'], _xchain, function chain(fn, monad) {
|
||||
if (typeof monad === 'function') {
|
||||
return function (x) {
|
||||
return fn(monad(x))(x);
|
||||
};
|
||||
}
|
||||
|
||||
return _makeFlat(false)(map(fn, monad));
|
||||
}));
|
||||
|
||||
export default chain;
|
33
node_modules/ramda/es/clamp.js
generated
vendored
Normal file
33
node_modules/ramda/es/clamp.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
import _curry3 from "./internal/_curry3.js";
|
||||
/**
|
||||
* Restricts a number to be within a range.
|
||||
*
|
||||
* Also works for other ordered types such as Strings and Dates.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.20.0
|
||||
* @category Relation
|
||||
* @sig Ord a => a -> a -> a -> a
|
||||
* @param {Number} minimum The lower limit of the clamp (inclusive)
|
||||
* @param {Number} maximum The upper limit of the clamp (inclusive)
|
||||
* @param {Number} value Value to be clamped
|
||||
* @return {Number} Returns `minimum` when `val < minimum`, `maximum` when `val > maximum`, returns `val` otherwise
|
||||
* @example
|
||||
*
|
||||
* R.clamp(1, 10, -5) // => 1
|
||||
* R.clamp(1, 10, 15) // => 10
|
||||
* R.clamp(1, 10, 4) // => 4
|
||||
*/
|
||||
|
||||
var clamp =
|
||||
/*#__PURE__*/
|
||||
_curry3(function clamp(min, max, value) {
|
||||
if (min > max) {
|
||||
throw new Error('min must not be greater than max in clamp(min, max, value)');
|
||||
}
|
||||
|
||||
return value < min ? min : value > max ? max : value;
|
||||
});
|
||||
|
||||
export default clamp;
|
31
node_modules/ramda/es/clone.js
generated
vendored
Normal file
31
node_modules/ramda/es/clone.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
import _clone from "./internal/_clone.js";
|
||||
import _curry1 from "./internal/_curry1.js";
|
||||
/**
|
||||
* Creates a deep copy of the value which may contain (nested) `Array`s and
|
||||
* `Object`s, `Number`s, `String`s, `Boolean`s and `Date`s. `Function`s are
|
||||
* assigned by reference rather than copied
|
||||
*
|
||||
* Dispatches to a `clone` method if present.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Object
|
||||
* @sig {*} -> {*}
|
||||
* @param {*} value The object or array to clone
|
||||
* @return {*} A deeply cloned copy of `val`
|
||||
* @example
|
||||
*
|
||||
* const objects = [{}, {}, {}];
|
||||
* const objectsClone = R.clone(objects);
|
||||
* objects === objectsClone; //=> false
|
||||
* objects[0] === objectsClone[0]; //=> false
|
||||
*/
|
||||
|
||||
var clone =
|
||||
/*#__PURE__*/
|
||||
_curry1(function clone(value) {
|
||||
return value != null && typeof value.clone === 'function' ? value.clone() : _clone(value, [], [], true);
|
||||
});
|
||||
|
||||
export default clone;
|
34
node_modules/ramda/es/comparator.js
generated
vendored
Normal file
34
node_modules/ramda/es/comparator.js
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
/**
|
||||
* Makes a comparator function out of a function that reports whether the first
|
||||
* element is less than the second.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Function
|
||||
* @sig ((a, b) -> Boolean) -> ((a, b) -> Number)
|
||||
* @param {Function} pred A predicate function of arity two which will return `true` if the first argument
|
||||
* is less than the second, `false` otherwise
|
||||
* @return {Function} A Function :: a -> b -> Int that returns `-1` if a < b, `1` if b < a, otherwise `0`
|
||||
* @example
|
||||
*
|
||||
* const byAge = R.comparator((a, b) => a.age < b.age);
|
||||
* const people = [
|
||||
* { name: 'Emma', age: 70 },
|
||||
* { name: 'Peter', age: 78 },
|
||||
* { name: 'Mikhail', age: 62 },
|
||||
* ];
|
||||
* const peopleByIncreasingAge = R.sort(byAge, people);
|
||||
* //=> [{ name: 'Mikhail', age: 62 },{ name: 'Emma', age: 70 }, { name: 'Peter', age: 78 }]
|
||||
*/
|
||||
|
||||
var comparator =
|
||||
/*#__PURE__*/
|
||||
_curry1(function comparator(pred) {
|
||||
return function (a, b) {
|
||||
return pred(a, b) ? -1 : pred(b, a) ? 1 : 0;
|
||||
};
|
||||
});
|
||||
|
||||
export default comparator;
|
29
node_modules/ramda/es/complement.js
generated
vendored
Normal file
29
node_modules/ramda/es/complement.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
import lift from "./lift.js";
|
||||
import not from "./not.js";
|
||||
/**
|
||||
* Takes a function `f` and returns a function `g` such that if called with the same arguments
|
||||
* when `f` returns a "truthy" value, `g` returns `false` and when `f` returns a "falsy" value `g` returns `true`.
|
||||
*
|
||||
* `R.complement` may be applied to any functor
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.12.0
|
||||
* @category Logic
|
||||
* @sig (*... -> *) -> (*... -> Boolean)
|
||||
* @param {Function} f
|
||||
* @return {Function}
|
||||
* @see R.not
|
||||
* @example
|
||||
*
|
||||
* const isNotNil = R.complement(R.isNil);
|
||||
* isNil(null); //=> true
|
||||
* isNotNil(null); //=> false
|
||||
* isNil(7); //=> false
|
||||
* isNotNil(7); //=> true
|
||||
*/
|
||||
|
||||
var complement =
|
||||
/*#__PURE__*/
|
||||
lift(not);
|
||||
export default complement;
|
34
node_modules/ramda/es/compose.js
generated
vendored
Normal file
34
node_modules/ramda/es/compose.js
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
import pipe from "./pipe.js";
|
||||
import reverse from "./reverse.js";
|
||||
/**
|
||||
* Performs right-to-left function composition. The last argument may have
|
||||
* any arity; the remaining arguments must be unary.
|
||||
*
|
||||
* **Note:** The result of compose is not automatically curried.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Function
|
||||
* @sig ((y -> z), (x -> y), ..., (o -> p), ((a, b, ..., n) -> o)) -> ((a, b, ..., n) -> z)
|
||||
* @param {...Function} ...functions The functions to compose
|
||||
* @return {Function}
|
||||
* @see R.pipe
|
||||
* @example
|
||||
*
|
||||
* const classyGreeting = (firstName, lastName) => "The name's " + lastName + ", " + firstName + " " + lastName
|
||||
* const yellGreeting = R.compose(R.toUpper, classyGreeting);
|
||||
* yellGreeting('James', 'Bond'); //=> "THE NAME'S BOND, JAMES BOND"
|
||||
*
|
||||
* R.compose(Math.abs, R.add(1), R.multiply(2))(-4) //=> 7
|
||||
*
|
||||
* @symb R.compose(f, g, h)(a, b) = f(g(h(a, b)))
|
||||
*/
|
||||
|
||||
export default function compose() {
|
||||
if (arguments.length === 0) {
|
||||
throw new Error('compose requires at least one argument');
|
||||
}
|
||||
|
||||
return pipe.apply(this, reverse(arguments));
|
||||
}
|
44
node_modules/ramda/es/composeK.js
generated
vendored
Normal file
44
node_modules/ramda/es/composeK.js
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
import chain from "./chain.js";
|
||||
import compose from "./compose.js";
|
||||
import map from "./map.js";
|
||||
/**
|
||||
* Returns the right-to-left Kleisli composition of the provided functions,
|
||||
* each of which must return a value of a type supported by [`chain`](#chain).
|
||||
*
|
||||
* `R.composeK(h, g, f)` is equivalent to `R.compose(R.chain(h), R.chain(g), f)`.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.16.0
|
||||
* @category Function
|
||||
* @sig Chain m => ((y -> m z), (x -> m y), ..., (a -> m b)) -> (a -> m z)
|
||||
* @param {...Function} ...functions The functions to compose
|
||||
* @return {Function}
|
||||
* @see R.pipeK
|
||||
* @deprecated since v0.26.0
|
||||
* @example
|
||||
*
|
||||
* // get :: String -> Object -> Maybe *
|
||||
* const get = R.curry((propName, obj) => Maybe(obj[propName]))
|
||||
*
|
||||
* // getStateCode :: Maybe String -> Maybe String
|
||||
* const getStateCode = R.composeK(
|
||||
* R.compose(Maybe.of, R.toUpper),
|
||||
* get('state'),
|
||||
* get('address'),
|
||||
* get('user'),
|
||||
* );
|
||||
* getStateCode({"user":{"address":{"state":"ny"}}}); //=> Maybe.Just("NY")
|
||||
* getStateCode({}); //=> Maybe.Nothing()
|
||||
* @symb R.composeK(f, g, h)(a) = R.chain(f, R.chain(g, h(a)))
|
||||
*/
|
||||
|
||||
export default function composeK() {
|
||||
if (arguments.length === 0) {
|
||||
throw new Error('composeK requires at least one argument');
|
||||
}
|
||||
|
||||
var init = Array.prototype.slice.call(arguments);
|
||||
var last = init.pop();
|
||||
return compose(compose.apply(this, map(chain, init)), last);
|
||||
}
|
45
node_modules/ramda/es/composeP.js
generated
vendored
Normal file
45
node_modules/ramda/es/composeP.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
import pipeP from "./pipeP.js";
|
||||
import reverse from "./reverse.js";
|
||||
/**
|
||||
* Performs right-to-left composition of one or more Promise-returning
|
||||
* functions. The last arguments may have any arity; the remaining
|
||||
* arguments must be unary.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.10.0
|
||||
* @category Function
|
||||
* @sig ((y -> Promise z), (x -> Promise y), ..., (a -> Promise b)) -> (a -> Promise z)
|
||||
* @param {...Function} functions The functions to compose
|
||||
* @return {Function}
|
||||
* @see R.pipeP
|
||||
* @deprecated since v0.26.0
|
||||
* @example
|
||||
*
|
||||
* const db = {
|
||||
* users: {
|
||||
* JOE: {
|
||||
* name: 'Joe',
|
||||
* followers: ['STEVE', 'SUZY']
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* // We'll pretend to do a db lookup which returns a promise
|
||||
* const lookupUser = (userId) => Promise.resolve(db.users[userId])
|
||||
* const lookupFollowers = (user) => Promise.resolve(user.followers)
|
||||
* lookupUser('JOE').then(lookupFollowers)
|
||||
*
|
||||
* // followersForUser :: String -> Promise [UserId]
|
||||
* const followersForUser = R.composeP(lookupFollowers, lookupUser);
|
||||
* followersForUser('JOE').then(followers => console.log('Followers:', followers))
|
||||
* // Followers: ["STEVE","SUZY"]
|
||||
*/
|
||||
|
||||
export default function composeP() {
|
||||
if (arguments.length === 0) {
|
||||
throw new Error('composeP requires at least one argument');
|
||||
}
|
||||
|
||||
return pipeP.apply(this, reverse(arguments));
|
||||
}
|
35
node_modules/ramda/es/composeWith.js
generated
vendored
Normal file
35
node_modules/ramda/es/composeWith.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import pipeWith from "./pipeWith.js";
|
||||
import reverse from "./reverse.js";
|
||||
/**
|
||||
* Performs right-to-left function composition using transforming function. The last argument may have
|
||||
* any arity; the remaining arguments must be unary.
|
||||
*
|
||||
* **Note:** The result of compose is not automatically curried. Transforming function is not used on the
|
||||
* last argument.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.26.0
|
||||
* @category Function
|
||||
* @sig ((* -> *), [(y -> z), (x -> y), ..., (o -> p), ((a, b, ..., n) -> o)]) -> ((a, b, ..., n) -> z)
|
||||
* @param {...Function} ...functions The functions to compose
|
||||
* @return {Function}
|
||||
* @see R.compose, R.pipeWith
|
||||
* @example
|
||||
*
|
||||
* const composeWhileNotNil = R.composeWith((f, res) => R.isNil(res) ? res : f(res));
|
||||
*
|
||||
* composeWhileNotNil([R.inc, R.prop('age')])({age: 1}) //=> 2
|
||||
* composeWhileNotNil([R.inc, R.prop('age')])({}) //=> undefined
|
||||
*
|
||||
* @symb R.composeWith(f)([g, h, i])(...args) = f(g, f(h, i(...args)))
|
||||
*/
|
||||
|
||||
var composeWith =
|
||||
/*#__PURE__*/
|
||||
_curry2(function composeWith(xf, list) {
|
||||
return pipeWith.apply(this, [xf, reverse(list)]);
|
||||
});
|
||||
|
||||
export default composeWith;
|
65
node_modules/ramda/es/concat.js
generated
vendored
Normal file
65
node_modules/ramda/es/concat.js
generated
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _isArray from "./internal/_isArray.js";
|
||||
import _isFunction from "./internal/_isFunction.js";
|
||||
import _isString from "./internal/_isString.js";
|
||||
import toString from "./toString.js";
|
||||
/**
|
||||
* Returns the result of concatenating the given lists or strings.
|
||||
*
|
||||
* Note: `R.concat` expects both arguments to be of the same type,
|
||||
* unlike the native `Array.prototype.concat` method. It will throw
|
||||
* an error if you `concat` an Array with a non-Array value.
|
||||
*
|
||||
* Dispatches to the `concat` method of the first argument, if present.
|
||||
* Can also concatenate two members of a [fantasy-land
|
||||
* compatible semigroup](https://github.com/fantasyland/fantasy-land#semigroup).
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig [a] -> [a] -> [a]
|
||||
* @sig String -> String -> String
|
||||
* @param {Array|String} firstList The first list
|
||||
* @param {Array|String} secondList The second list
|
||||
* @return {Array|String} A list consisting of the elements of `firstList` followed by the elements of
|
||||
* `secondList`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* R.concat('ABC', 'DEF'); // 'ABCDEF'
|
||||
* R.concat([4, 5, 6], [1, 2, 3]); //=> [4, 5, 6, 1, 2, 3]
|
||||
* R.concat([], []); //=> []
|
||||
*/
|
||||
|
||||
var concat =
|
||||
/*#__PURE__*/
|
||||
_curry2(function concat(a, b) {
|
||||
if (_isArray(a)) {
|
||||
if (_isArray(b)) {
|
||||
return a.concat(b);
|
||||
}
|
||||
|
||||
throw new TypeError(toString(b) + ' is not an array');
|
||||
}
|
||||
|
||||
if (_isString(a)) {
|
||||
if (_isString(b)) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
throw new TypeError(toString(b) + ' is not a string');
|
||||
}
|
||||
|
||||
if (a != null && _isFunction(a['fantasy-land/concat'])) {
|
||||
return a['fantasy-land/concat'](b);
|
||||
}
|
||||
|
||||
if (a != null && _isFunction(a.concat)) {
|
||||
return a.concat(b);
|
||||
}
|
||||
|
||||
throw new TypeError(toString(a) + ' does not have a method named "concat" or "fantasy-land/concat"');
|
||||
});
|
||||
|
||||
export default concat;
|
53
node_modules/ramda/es/cond.js
generated
vendored
Normal file
53
node_modules/ramda/es/cond.js
generated
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
import _arity from "./internal/_arity.js";
|
||||
import _curry1 from "./internal/_curry1.js";
|
||||
import map from "./map.js";
|
||||
import max from "./max.js";
|
||||
import reduce from "./reduce.js";
|
||||
/**
|
||||
* Returns a function, `fn`, which encapsulates `if/else, if/else, ...` logic.
|
||||
* `R.cond` takes a list of [predicate, transformer] pairs. All of the arguments
|
||||
* to `fn` are applied to each of the predicates in turn until one returns a
|
||||
* "truthy" value, at which point `fn` returns the result of applying its
|
||||
* arguments to the corresponding transformer. If none of the predicates
|
||||
* matches, `fn` returns undefined.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.6.0
|
||||
* @category Logic
|
||||
* @sig [[(*... -> Boolean),(*... -> *)]] -> (*... -> *)
|
||||
* @param {Array} pairs A list of [predicate, transformer]
|
||||
* @return {Function}
|
||||
* @see R.ifElse, R.unless, R.when
|
||||
* @example
|
||||
*
|
||||
* const fn = R.cond([
|
||||
* [R.equals(0), R.always('water freezes at 0°C')],
|
||||
* [R.equals(100), R.always('water boils at 100°C')],
|
||||
* [R.T, temp => 'nothing special happens at ' + temp + '°C']
|
||||
* ]);
|
||||
* fn(0); //=> 'water freezes at 0°C'
|
||||
* fn(50); //=> 'nothing special happens at 50°C'
|
||||
* fn(100); //=> 'water boils at 100°C'
|
||||
*/
|
||||
|
||||
var cond =
|
||||
/*#__PURE__*/
|
||||
_curry1(function cond(pairs) {
|
||||
var arity = reduce(max, 0, map(function (pair) {
|
||||
return pair[0].length;
|
||||
}, pairs));
|
||||
return _arity(arity, function () {
|
||||
var idx = 0;
|
||||
|
||||
while (idx < pairs.length) {
|
||||
if (pairs[idx][0].apply(this, arguments)) {
|
||||
return pairs[idx][1].apply(this, arguments);
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
export default cond;
|
42
node_modules/ramda/es/construct.js
generated
vendored
Normal file
42
node_modules/ramda/es/construct.js
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import constructN from "./constructN.js";
|
||||
/**
|
||||
* Wraps a constructor function inside a curried function that can be called
|
||||
* with the same arguments and returns the same type.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Function
|
||||
* @sig (* -> {*}) -> (* -> {*})
|
||||
* @param {Function} fn The constructor function to wrap.
|
||||
* @return {Function} A wrapped, curried constructor function.
|
||||
* @see R.invoker
|
||||
* @example
|
||||
*
|
||||
* // Constructor function
|
||||
* function Animal(kind) {
|
||||
* this.kind = kind;
|
||||
* };
|
||||
* Animal.prototype.sighting = function() {
|
||||
* return "It's a " + this.kind + "!";
|
||||
* }
|
||||
*
|
||||
* const AnimalConstructor = R.construct(Animal)
|
||||
*
|
||||
* // Notice we no longer need the 'new' keyword:
|
||||
* AnimalConstructor('Pig'); //=> {"kind": "Pig", "sighting": function (){...}};
|
||||
*
|
||||
* const animalTypes = ["Lion", "Tiger", "Bear"];
|
||||
* const animalSighting = R.invoker(0, 'sighting');
|
||||
* const sightNewAnimal = R.compose(animalSighting, AnimalConstructor);
|
||||
* R.map(sightNewAnimal, animalTypes); //=> ["It's a Lion!", "It's a Tiger!", "It's a Bear!"]
|
||||
*/
|
||||
|
||||
var construct =
|
||||
/*#__PURE__*/
|
||||
_curry1(function construct(Fn) {
|
||||
return constructN(Fn.length, Fn);
|
||||
});
|
||||
|
||||
export default construct;
|
88
node_modules/ramda/es/constructN.js
generated
vendored
Normal file
88
node_modules/ramda/es/constructN.js
generated
vendored
Normal file
|
@ -0,0 +1,88 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import curry from "./curry.js";
|
||||
import nAry from "./nAry.js";
|
||||
/**
|
||||
* Wraps a constructor function inside a curried function that can be called
|
||||
* with the same arguments and returns the same type. The arity of the function
|
||||
* returned is specified to allow using variadic constructor functions.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.4.0
|
||||
* @category Function
|
||||
* @sig Number -> (* -> {*}) -> (* -> {*})
|
||||
* @param {Number} n The arity of the constructor function.
|
||||
* @param {Function} Fn The constructor function to wrap.
|
||||
* @return {Function} A wrapped, curried constructor function.
|
||||
* @example
|
||||
*
|
||||
* // Variadic Constructor function
|
||||
* function Salad() {
|
||||
* this.ingredients = arguments;
|
||||
* }
|
||||
*
|
||||
* Salad.prototype.recipe = function() {
|
||||
* const instructions = R.map(ingredient => 'Add a dollop of ' + ingredient, this.ingredients);
|
||||
* return R.join('\n', instructions);
|
||||
* };
|
||||
*
|
||||
* const ThreeLayerSalad = R.constructN(3, Salad);
|
||||
*
|
||||
* // Notice we no longer need the 'new' keyword, and the constructor is curried for 3 arguments.
|
||||
* const salad = ThreeLayerSalad('Mayonnaise')('Potato Chips')('Ketchup');
|
||||
*
|
||||
* console.log(salad.recipe());
|
||||
* // Add a dollop of Mayonnaise
|
||||
* // Add a dollop of Potato Chips
|
||||
* // Add a dollop of Ketchup
|
||||
*/
|
||||
|
||||
var constructN =
|
||||
/*#__PURE__*/
|
||||
_curry2(function constructN(n, Fn) {
|
||||
if (n > 10) {
|
||||
throw new Error('Constructor with greater than ten arguments');
|
||||
}
|
||||
|
||||
if (n === 0) {
|
||||
return function () {
|
||||
return new Fn();
|
||||
};
|
||||
}
|
||||
|
||||
return curry(nAry(n, function ($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {
|
||||
switch (arguments.length) {
|
||||
case 1:
|
||||
return new Fn($0);
|
||||
|
||||
case 2:
|
||||
return new Fn($0, $1);
|
||||
|
||||
case 3:
|
||||
return new Fn($0, $1, $2);
|
||||
|
||||
case 4:
|
||||
return new Fn($0, $1, $2, $3);
|
||||
|
||||
case 5:
|
||||
return new Fn($0, $1, $2, $3, $4);
|
||||
|
||||
case 6:
|
||||
return new Fn($0, $1, $2, $3, $4, $5);
|
||||
|
||||
case 7:
|
||||
return new Fn($0, $1, $2, $3, $4, $5, $6);
|
||||
|
||||
case 8:
|
||||
return new Fn($0, $1, $2, $3, $4, $5, $6, $7);
|
||||
|
||||
case 9:
|
||||
return new Fn($0, $1, $2, $3, $4, $5, $6, $7, $8);
|
||||
|
||||
case 10:
|
||||
return new Fn($0, $1, $2, $3, $4, $5, $6, $7, $8, $9);
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
export default constructN;
|
31
node_modules/ramda/es/contains.js
generated
vendored
Normal file
31
node_modules/ramda/es/contains.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
import _includes from "./internal/_includes.js";
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Returns `true` if the specified value is equal, in [`R.equals`](#equals)
|
||||
* terms, to at least one element of the given list; `false` otherwise.
|
||||
* Works also with strings.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig a -> [a] -> Boolean
|
||||
* @param {Object} a The item to compare against.
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Boolean} `true` if an equivalent item is in the list, `false` otherwise.
|
||||
* @see R.includes
|
||||
* @deprecated since v0.26.0
|
||||
* @example
|
||||
*
|
||||
* R.contains(3, [1, 2, 3]); //=> true
|
||||
* R.contains(4, [1, 2, 3]); //=> false
|
||||
* R.contains({ name: 'Fred' }, [{ name: 'Fred' }]); //=> true
|
||||
* R.contains([42], [[42]]); //=> true
|
||||
* R.contains('ba', 'banana'); //=>true
|
||||
*/
|
||||
|
||||
var contains =
|
||||
/*#__PURE__*/
|
||||
_curry2(_includes);
|
||||
|
||||
export default contains;
|
48
node_modules/ramda/es/converge.js
generated
vendored
Normal file
48
node_modules/ramda/es/converge.js
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _map from "./internal/_map.js";
|
||||
import curryN from "./curryN.js";
|
||||
import max from "./max.js";
|
||||
import pluck from "./pluck.js";
|
||||
import reduce from "./reduce.js";
|
||||
/**
|
||||
* Accepts a converging function and a list of branching functions and returns
|
||||
* a new function. The arity of the new function is the same as the arity of
|
||||
* the longest branching function. When invoked, this new function is applied
|
||||
* to some arguments, and each branching function is applied to those same
|
||||
* arguments. The results of each branching function are passed as arguments
|
||||
* to the converging function to produce the return value.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.4.2
|
||||
* @category Function
|
||||
* @sig ((x1, x2, ...) -> z) -> [((a, b, ...) -> x1), ((a, b, ...) -> x2), ...] -> (a -> b -> ... -> z)
|
||||
* @param {Function} after A function. `after` will be invoked with the return values of
|
||||
* `fn1` and `fn2` as its arguments.
|
||||
* @param {Array} functions A list of functions.
|
||||
* @return {Function} A new function.
|
||||
* @see R.useWith
|
||||
* @example
|
||||
*
|
||||
* const average = R.converge(R.divide, [R.sum, R.length])
|
||||
* average([1, 2, 3, 4, 5, 6, 7]) //=> 4
|
||||
*
|
||||
* const strangeConcat = R.converge(R.concat, [R.toUpper, R.toLower])
|
||||
* strangeConcat("Yodel") //=> "YODELyodel"
|
||||
*
|
||||
* @symb R.converge(f, [g, h])(a, b) = f(g(a, b), h(a, b))
|
||||
*/
|
||||
|
||||
var converge =
|
||||
/*#__PURE__*/
|
||||
_curry2(function converge(after, fns) {
|
||||
return curryN(reduce(max, 0, pluck('length', fns)), function () {
|
||||
var args = arguments;
|
||||
var context = this;
|
||||
return after.apply(context, _map(function (fn) {
|
||||
return fn.apply(context, args);
|
||||
}, fns));
|
||||
});
|
||||
});
|
||||
|
||||
export default converge;
|
32
node_modules/ramda/es/countBy.js
generated
vendored
Normal file
32
node_modules/ramda/es/countBy.js
generated
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
import reduceBy from "./reduceBy.js";
|
||||
/**
|
||||
* Counts the elements of a list according to how many match each value of a
|
||||
* key generated by the supplied function. Returns an object mapping the keys
|
||||
* produced by `fn` to the number of occurrences in the list. Note that all
|
||||
* keys are coerced to strings because of how JavaScript objects work.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Relation
|
||||
* @sig (a -> String) -> [a] -> {*}
|
||||
* @param {Function} fn The function used to map values to keys.
|
||||
* @param {Array} list The list to count elements from.
|
||||
* @return {Object} An object mapping keys to number of occurrences in the list.
|
||||
* @example
|
||||
*
|
||||
* const numbers = [1.0, 1.1, 1.2, 2.0, 3.0, 2.2];
|
||||
* R.countBy(Math.floor)(numbers); //=> {'1': 3, '2': 2, '3': 1}
|
||||
*
|
||||
* const letters = ['a', 'b', 'A', 'a', 'B', 'c'];
|
||||
* R.countBy(R.toLower)(letters); //=> {'a': 3, 'b': 2, 'c': 1}
|
||||
*/
|
||||
|
||||
var countBy =
|
||||
/*#__PURE__*/
|
||||
reduceBy(function (acc, elem) {
|
||||
return acc + 1;
|
||||
}, 0);
|
||||
export default countBy;
|
51
node_modules/ramda/es/curry.js
generated
vendored
Normal file
51
node_modules/ramda/es/curry.js
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import curryN from "./curryN.js";
|
||||
/**
|
||||
* Returns a curried equivalent of the provided function. The curried function
|
||||
* has two unusual capabilities. First, its arguments needn't be provided one
|
||||
* at a time. If `f` is a ternary function and `g` is `R.curry(f)`, the
|
||||
* following are equivalent:
|
||||
*
|
||||
* - `g(1)(2)(3)`
|
||||
* - `g(1)(2, 3)`
|
||||
* - `g(1, 2)(3)`
|
||||
* - `g(1, 2, 3)`
|
||||
*
|
||||
* Secondly, the special placeholder value [`R.__`](#__) may be used to specify
|
||||
* "gaps", allowing partial application of any combination of arguments,
|
||||
* regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),
|
||||
* the following are equivalent:
|
||||
*
|
||||
* - `g(1, 2, 3)`
|
||||
* - `g(_, 2, 3)(1)`
|
||||
* - `g(_, _, 3)(1)(2)`
|
||||
* - `g(_, _, 3)(1, 2)`
|
||||
* - `g(_, 2)(1)(3)`
|
||||
* - `g(_, 2)(1, 3)`
|
||||
* - `g(_, 2)(_, 3)(1)`
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Function
|
||||
* @sig (* -> a) -> (* -> a)
|
||||
* @param {Function} fn The function to curry.
|
||||
* @return {Function} A new, curried function.
|
||||
* @see R.curryN, R.partial
|
||||
* @example
|
||||
*
|
||||
* const addFourNumbers = (a, b, c, d) => a + b + c + d;
|
||||
*
|
||||
* const curriedAddFourNumbers = R.curry(addFourNumbers);
|
||||
* const f = curriedAddFourNumbers(1, 2);
|
||||
* const g = f(3);
|
||||
* g(4); //=> 10
|
||||
*/
|
||||
|
||||
var curry =
|
||||
/*#__PURE__*/
|
||||
_curry1(function curry(fn) {
|
||||
return curryN(fn.length, fn);
|
||||
});
|
||||
|
||||
export default curry;
|
58
node_modules/ramda/es/curryN.js
generated
vendored
Normal file
58
node_modules/ramda/es/curryN.js
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
import _arity from "./internal/_arity.js";
|
||||
import _curry1 from "./internal/_curry1.js";
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
import _curryN from "./internal/_curryN.js";
|
||||
/**
|
||||
* Returns a curried equivalent of the provided function, with the specified
|
||||
* arity. The curried function has two unusual capabilities. First, its
|
||||
* arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the
|
||||
* following are equivalent:
|
||||
*
|
||||
* - `g(1)(2)(3)`
|
||||
* - `g(1)(2, 3)`
|
||||
* - `g(1, 2)(3)`
|
||||
* - `g(1, 2, 3)`
|
||||
*
|
||||
* Secondly, the special placeholder value [`R.__`](#__) may be used to specify
|
||||
* "gaps", allowing partial application of any combination of arguments,
|
||||
* regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),
|
||||
* the following are equivalent:
|
||||
*
|
||||
* - `g(1, 2, 3)`
|
||||
* - `g(_, 2, 3)(1)`
|
||||
* - `g(_, _, 3)(1)(2)`
|
||||
* - `g(_, _, 3)(1, 2)`
|
||||
* - `g(_, 2)(1)(3)`
|
||||
* - `g(_, 2)(1, 3)`
|
||||
* - `g(_, 2)(_, 3)(1)`
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.5.0
|
||||
* @category Function
|
||||
* @sig Number -> (* -> a) -> (* -> a)
|
||||
* @param {Number} length The arity for the returned function.
|
||||
* @param {Function} fn The function to curry.
|
||||
* @return {Function} A new, curried function.
|
||||
* @see R.curry
|
||||
* @example
|
||||
*
|
||||
* const sumArgs = (...args) => R.sum(args);
|
||||
*
|
||||
* const curriedAddFourNumbers = R.curryN(4, sumArgs);
|
||||
* const f = curriedAddFourNumbers(1, 2);
|
||||
* const g = f(3);
|
||||
* g(4); //=> 10
|
||||
*/
|
||||
|
||||
var curryN =
|
||||
/*#__PURE__*/
|
||||
_curry2(function curryN(length, fn) {
|
||||
if (length === 1) {
|
||||
return _curry1(fn);
|
||||
}
|
||||
|
||||
return _arity(length, _curryN(length, [], fn));
|
||||
});
|
||||
|
||||
export default curryN;
|
21
node_modules/ramda/es/dec.js
generated
vendored
Normal file
21
node_modules/ramda/es/dec.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
import add from "./add.js";
|
||||
/**
|
||||
* Decrements its argument.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category Math
|
||||
* @sig Number -> Number
|
||||
* @param {Number} n
|
||||
* @return {Number} n - 1
|
||||
* @see R.inc
|
||||
* @example
|
||||
*
|
||||
* R.dec(42); //=> 41
|
||||
*/
|
||||
|
||||
var dec =
|
||||
/*#__PURE__*/
|
||||
add(-1);
|
||||
export default dec;
|
32
node_modules/ramda/es/defaultTo.js
generated
vendored
Normal file
32
node_modules/ramda/es/defaultTo.js
generated
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Returns the second argument if it is not `null`, `undefined` or `NaN`;
|
||||
* otherwise the first argument is returned.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.10.0
|
||||
* @category Logic
|
||||
* @sig a -> b -> a | b
|
||||
* @param {a} default The default value.
|
||||
* @param {b} val `val` will be returned instead of `default` unless `val` is `null`, `undefined` or `NaN`.
|
||||
* @return {*} The second value if it is not `null`, `undefined` or `NaN`, otherwise the default value
|
||||
* @example
|
||||
*
|
||||
* const defaultTo42 = R.defaultTo(42);
|
||||
*
|
||||
* defaultTo42(null); //=> 42
|
||||
* defaultTo42(undefined); //=> 42
|
||||
* defaultTo42(false); //=> false
|
||||
* defaultTo42('Ramda'); //=> 'Ramda'
|
||||
* // parseInt('string') results in NaN
|
||||
* defaultTo42(parseInt('string')); //=> 42
|
||||
*/
|
||||
|
||||
var defaultTo =
|
||||
/*#__PURE__*/
|
||||
_curry2(function defaultTo(d, v) {
|
||||
return v == null || v !== v ? d : v;
|
||||
});
|
||||
|
||||
export default defaultTo;
|
36
node_modules/ramda/es/descend.js
generated
vendored
Normal file
36
node_modules/ramda/es/descend.js
generated
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
import _curry3 from "./internal/_curry3.js";
|
||||
/**
|
||||
* Makes a descending comparator function out of a function that returns a value
|
||||
* that can be compared with `<` and `>`.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.23.0
|
||||
* @category Function
|
||||
* @sig Ord b => (a -> b) -> a -> a -> Number
|
||||
* @param {Function} fn A function of arity one that returns a value that can be compared
|
||||
* @param {*} a The first item to be compared.
|
||||
* @param {*} b The second item to be compared.
|
||||
* @return {Number} `-1` if fn(a) > fn(b), `1` if fn(b) > fn(a), otherwise `0`
|
||||
* @see R.ascend
|
||||
* @example
|
||||
*
|
||||
* const byAge = R.descend(R.prop('age'));
|
||||
* const people = [
|
||||
* { name: 'Emma', age: 70 },
|
||||
* { name: 'Peter', age: 78 },
|
||||
* { name: 'Mikhail', age: 62 },
|
||||
* ];
|
||||
* const peopleByOldestFirst = R.sort(byAge, people);
|
||||
* //=> [{ name: 'Peter', age: 78 }, { name: 'Emma', age: 70 }, { name: 'Mikhail', age: 62 }]
|
||||
*/
|
||||
|
||||
var descend =
|
||||
/*#__PURE__*/
|
||||
_curry3(function descend(fn, a, b) {
|
||||
var aa = fn(a);
|
||||
var bb = fn(b);
|
||||
return aa > bb ? -1 : aa < bb ? 1 : 0;
|
||||
});
|
||||
|
||||
export default descend;
|
48
node_modules/ramda/es/difference.js
generated
vendored
Normal file
48
node_modules/ramda/es/difference.js
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _Set from "./internal/_Set.js";
|
||||
/**
|
||||
* Finds the set (i.e. no duplicates) of all elements in the first list not
|
||||
* contained in the second list. Objects and Arrays are compared in terms of
|
||||
* value equality, not reference equality.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Relation
|
||||
* @sig [*] -> [*] -> [*]
|
||||
* @param {Array} list1 The first list.
|
||||
* @param {Array} list2 The second list.
|
||||
* @return {Array} The elements in `list1` that are not in `list2`.
|
||||
* @see R.differenceWith, R.symmetricDifference, R.symmetricDifferenceWith, R.without
|
||||
* @example
|
||||
*
|
||||
* R.difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]
|
||||
* R.difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]
|
||||
* R.difference([{a: 1}, {b: 2}], [{a: 1}, {c: 3}]) //=> [{b: 2}]
|
||||
*/
|
||||
|
||||
var difference =
|
||||
/*#__PURE__*/
|
||||
_curry2(function difference(first, second) {
|
||||
var out = [];
|
||||
var idx = 0;
|
||||
var firstLen = first.length;
|
||||
var secondLen = second.length;
|
||||
var toFilterOut = new _Set();
|
||||
|
||||
for (var i = 0; i < secondLen; i += 1) {
|
||||
toFilterOut.add(second[i]);
|
||||
}
|
||||
|
||||
while (idx < firstLen) {
|
||||
if (toFilterOut.add(first[idx])) {
|
||||
out[out.length] = first[idx];
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return out;
|
||||
});
|
||||
|
||||
export default difference;
|
44
node_modules/ramda/es/differenceWith.js
generated
vendored
Normal file
44
node_modules/ramda/es/differenceWith.js
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
import _includesWith from "./internal/_includesWith.js";
|
||||
import _curry3 from "./internal/_curry3.js";
|
||||
/**
|
||||
* Finds the set (i.e. no duplicates) of all elements in the first list not
|
||||
* contained in the second list. Duplication is determined according to the
|
||||
* value returned by applying the supplied predicate to two list elements.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Relation
|
||||
* @sig ((a, a) -> Boolean) -> [a] -> [a] -> [a]
|
||||
* @param {Function} pred A predicate used to test whether two items are equal.
|
||||
* @param {Array} list1 The first list.
|
||||
* @param {Array} list2 The second list.
|
||||
* @return {Array} The elements in `list1` that are not in `list2`.
|
||||
* @see R.difference, R.symmetricDifference, R.symmetricDifferenceWith
|
||||
* @example
|
||||
*
|
||||
* const cmp = (x, y) => x.a === y.a;
|
||||
* const l1 = [{a: 1}, {a: 2}, {a: 3}];
|
||||
* const l2 = [{a: 3}, {a: 4}];
|
||||
* R.differenceWith(cmp, l1, l2); //=> [{a: 1}, {a: 2}]
|
||||
*/
|
||||
|
||||
var differenceWith =
|
||||
/*#__PURE__*/
|
||||
_curry3(function differenceWith(pred, first, second) {
|
||||
var out = [];
|
||||
var idx = 0;
|
||||
var firstLen = first.length;
|
||||
|
||||
while (idx < firstLen) {
|
||||
if (!_includesWith(pred, first[idx], second) && !_includesWith(pred, first[idx], out)) {
|
||||
out.push(first[idx]);
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return out;
|
||||
});
|
||||
|
||||
export default differenceWith;
|
32
node_modules/ramda/es/dissoc.js
generated
vendored
Normal file
32
node_modules/ramda/es/dissoc.js
generated
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Returns a new object that does not contain a `prop` property.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.10.0
|
||||
* @category Object
|
||||
* @sig String -> {k: v} -> {k: v}
|
||||
* @param {String} prop The name of the property to dissociate
|
||||
* @param {Object} obj The object to clone
|
||||
* @return {Object} A new object equivalent to the original but without the specified property
|
||||
* @see R.assoc, R.omit
|
||||
* @example
|
||||
*
|
||||
* R.dissoc('b', {a: 1, b: 2, c: 3}); //=> {a: 1, c: 3}
|
||||
*/
|
||||
|
||||
var dissoc =
|
||||
/*#__PURE__*/
|
||||
_curry2(function dissoc(prop, obj) {
|
||||
var result = {};
|
||||
|
||||
for (var p in obj) {
|
||||
result[p] = obj[p];
|
||||
}
|
||||
|
||||
delete result[prop];
|
||||
return result;
|
||||
});
|
||||
|
||||
export default dissoc;
|
53
node_modules/ramda/es/dissocPath.js
generated
vendored
Normal file
53
node_modules/ramda/es/dissocPath.js
generated
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _isInteger from "./internal/_isInteger.js";
|
||||
import _isArray from "./internal/_isArray.js";
|
||||
import assoc from "./assoc.js";
|
||||
import dissoc from "./dissoc.js";
|
||||
import remove from "./remove.js";
|
||||
import update from "./update.js";
|
||||
/**
|
||||
* Makes a shallow clone of an object, omitting the property at the given path.
|
||||
* Note that this copies and flattens prototype properties onto the new object
|
||||
* as well. All non-primitive properties are copied by reference.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.11.0
|
||||
* @category Object
|
||||
* @typedefn Idx = String | Int
|
||||
* @sig [Idx] -> {k: v} -> {k: v}
|
||||
* @param {Array} path The path to the value to omit
|
||||
* @param {Object} obj The object to clone
|
||||
* @return {Object} A new object without the property at path
|
||||
* @see R.assocPath
|
||||
* @example
|
||||
*
|
||||
* R.dissocPath(['a', 'b', 'c'], {a: {b: {c: 42}}}); //=> {a: {b: {}}}
|
||||
*/
|
||||
|
||||
var dissocPath =
|
||||
/*#__PURE__*/
|
||||
_curry2(function dissocPath(path, obj) {
|
||||
switch (path.length) {
|
||||
case 0:
|
||||
return obj;
|
||||
|
||||
case 1:
|
||||
return _isInteger(path[0]) && _isArray(obj) ? remove(path[0], 1, obj) : dissoc(path[0], obj);
|
||||
|
||||
default:
|
||||
var head = path[0];
|
||||
var tail = Array.prototype.slice.call(path, 1);
|
||||
|
||||
if (obj[head] == null) {
|
||||
return obj;
|
||||
} else if (_isInteger(head) && _isArray(obj)) {
|
||||
return update(head, dissocPath(tail, obj[head]), obj);
|
||||
} else {
|
||||
return assoc(head, dissocPath(tail, obj[head]), obj);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
export default dissocPath;
|
31
node_modules/ramda/es/divide.js
generated
vendored
Normal file
31
node_modules/ramda/es/divide.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Divides two numbers. Equivalent to `a / b`.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Math
|
||||
* @sig Number -> Number -> Number
|
||||
* @param {Number} a The first value.
|
||||
* @param {Number} b The second value.
|
||||
* @return {Number} The result of `a / b`.
|
||||
* @see R.multiply
|
||||
* @example
|
||||
*
|
||||
* R.divide(71, 100); //=> 0.71
|
||||
*
|
||||
* const half = R.divide(R.__, 2);
|
||||
* half(42); //=> 21
|
||||
*
|
||||
* const reciprocal = R.divide(1);
|
||||
* reciprocal(4); //=> 0.25
|
||||
*/
|
||||
|
||||
var divide =
|
||||
/*#__PURE__*/
|
||||
_curry2(function divide(a, b) {
|
||||
return a / b;
|
||||
});
|
||||
|
||||
export default divide;
|
38
node_modules/ramda/es/drop.js
generated
vendored
Normal file
38
node_modules/ramda/es/drop.js
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xdrop from "./internal/_xdrop.js";
|
||||
import slice from "./slice.js";
|
||||
/**
|
||||
* Returns all but the first `n` elements of the given list, string, or
|
||||
* transducer/transformer (or object with a `drop` method).
|
||||
*
|
||||
* Dispatches to the `drop` method of the second argument, if present.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig Number -> [a] -> [a]
|
||||
* @sig Number -> String -> String
|
||||
* @param {Number} n
|
||||
* @param {*} list
|
||||
* @return {*} A copy of list without the first `n` elements
|
||||
* @see R.take, R.transduce, R.dropLast, R.dropWhile
|
||||
* @example
|
||||
*
|
||||
* R.drop(1, ['foo', 'bar', 'baz']); //=> ['bar', 'baz']
|
||||
* R.drop(2, ['foo', 'bar', 'baz']); //=> ['baz']
|
||||
* R.drop(3, ['foo', 'bar', 'baz']); //=> []
|
||||
* R.drop(4, ['foo', 'bar', 'baz']); //=> []
|
||||
* R.drop(3, 'ramda'); //=> 'da'
|
||||
*/
|
||||
|
||||
var drop =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable(['drop'], _xdrop, function drop(n, xs) {
|
||||
return slice(Math.max(0, n), Infinity, xs);
|
||||
}));
|
||||
|
||||
export default drop;
|
35
node_modules/ramda/es/dropLast.js
generated
vendored
Normal file
35
node_modules/ramda/es/dropLast.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _dropLast from "./internal/_dropLast.js";
|
||||
import _xdropLast from "./internal/_xdropLast.js";
|
||||
/**
|
||||
* Returns a list containing all but the last `n` elements of the given `list`.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.16.0
|
||||
* @category List
|
||||
* @sig Number -> [a] -> [a]
|
||||
* @sig Number -> String -> String
|
||||
* @param {Number} n The number of elements of `list` to skip.
|
||||
* @param {Array} list The list of elements to consider.
|
||||
* @return {Array} A copy of the list with only the first `list.length - n` elements
|
||||
* @see R.takeLast, R.drop, R.dropWhile, R.dropLastWhile
|
||||
* @example
|
||||
*
|
||||
* R.dropLast(1, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']
|
||||
* R.dropLast(2, ['foo', 'bar', 'baz']); //=> ['foo']
|
||||
* R.dropLast(3, ['foo', 'bar', 'baz']); //=> []
|
||||
* R.dropLast(4, ['foo', 'bar', 'baz']); //=> []
|
||||
* R.dropLast(3, 'ramda'); //=> 'ra'
|
||||
*/
|
||||
|
||||
var dropLast =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable([], _xdropLast, _dropLast));
|
||||
|
||||
export default dropLast;
|
39
node_modules/ramda/es/dropLastWhile.js
generated
vendored
Normal file
39
node_modules/ramda/es/dropLastWhile.js
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _dropLastWhile from "./internal/_dropLastWhile.js";
|
||||
import _xdropLastWhile from "./internal/_xdropLastWhile.js";
|
||||
/**
|
||||
* Returns a new list excluding all the tailing elements of a given list which
|
||||
* satisfy the supplied predicate function. It passes each value from the right
|
||||
* to the supplied predicate function, skipping elements until the predicate
|
||||
* function returns a `falsy` value. The predicate function is applied to one argument:
|
||||
* *(value)*.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.16.0
|
||||
* @category List
|
||||
* @sig (a -> Boolean) -> [a] -> [a]
|
||||
* @sig (a -> Boolean) -> String -> String
|
||||
* @param {Function} predicate The function to be called on each element
|
||||
* @param {Array} xs The collection to iterate over.
|
||||
* @return {Array} A new array without any trailing elements that return `falsy` values from the `predicate`.
|
||||
* @see R.takeLastWhile, R.addIndex, R.drop, R.dropWhile
|
||||
* @example
|
||||
*
|
||||
* const lteThree = x => x <= 3;
|
||||
*
|
||||
* R.dropLastWhile(lteThree, [1, 2, 3, 4, 3, 2, 1]); //=> [1, 2, 3, 4]
|
||||
*
|
||||
* R.dropLastWhile(x => x !== 'd' , 'Ramda'); //=> 'Ramd'
|
||||
*/
|
||||
|
||||
var dropLastWhile =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable([], _xdropLastWhile, _dropLastWhile));
|
||||
|
||||
export default dropLastWhile;
|
35
node_modules/ramda/es/dropRepeats.js
generated
vendored
Normal file
35
node_modules/ramda/es/dropRepeats.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xdropRepeatsWith from "./internal/_xdropRepeatsWith.js";
|
||||
import dropRepeatsWith from "./dropRepeatsWith.js";
|
||||
import equals from "./equals.js";
|
||||
/**
|
||||
* Returns a new list without any consecutively repeating elements.
|
||||
* [`R.equals`](#equals) is used to determine equality.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.14.0
|
||||
* @category List
|
||||
* @sig [a] -> [a]
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Array} `list` without repeating elements.
|
||||
* @see R.transduce
|
||||
* @example
|
||||
*
|
||||
* R.dropRepeats([1, 1, 1, 2, 3, 4, 4, 2, 2]); //=> [1, 2, 3, 4, 2]
|
||||
*/
|
||||
|
||||
var dropRepeats =
|
||||
/*#__PURE__*/
|
||||
_curry1(
|
||||
/*#__PURE__*/
|
||||
_dispatchable([],
|
||||
/*#__PURE__*/
|
||||
_xdropRepeatsWith(equals),
|
||||
/*#__PURE__*/
|
||||
dropRepeatsWith(equals)));
|
||||
|
||||
export default dropRepeats;
|
51
node_modules/ramda/es/dropRepeatsWith.js
generated
vendored
Normal file
51
node_modules/ramda/es/dropRepeatsWith.js
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xdropRepeatsWith from "./internal/_xdropRepeatsWith.js";
|
||||
import last from "./last.js";
|
||||
/**
|
||||
* Returns a new list without any consecutively repeating elements. Equality is
|
||||
* determined by applying the supplied predicate to each pair of consecutive elements. The
|
||||
* first element in a series of equal elements will be preserved.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.14.0
|
||||
* @category List
|
||||
* @sig ((a, a) -> Boolean) -> [a] -> [a]
|
||||
* @param {Function} pred A predicate used to test whether two items are equal.
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Array} `list` without repeating elements.
|
||||
* @see R.transduce
|
||||
* @example
|
||||
*
|
||||
* const l = [1, -1, 1, 3, 4, -4, -4, -5, 5, 3, 3];
|
||||
* R.dropRepeatsWith(R.eqBy(Math.abs), l); //=> [1, 3, 4, -5, 3]
|
||||
*/
|
||||
|
||||
var dropRepeatsWith =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable([], _xdropRepeatsWith, function dropRepeatsWith(pred, list) {
|
||||
var result = [];
|
||||
var idx = 1;
|
||||
var len = list.length;
|
||||
|
||||
if (len !== 0) {
|
||||
result[0] = list[0];
|
||||
|
||||
while (idx < len) {
|
||||
if (!pred(last(result), list[idx])) {
|
||||
result[result.length] = list[idx];
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}));
|
||||
|
||||
export default dropRepeatsWith;
|
49
node_modules/ramda/es/dropWhile.js
generated
vendored
Normal file
49
node_modules/ramda/es/dropWhile.js
generated
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xdropWhile from "./internal/_xdropWhile.js";
|
||||
import slice from "./slice.js";
|
||||
/**
|
||||
* Returns a new list excluding the leading elements of a given list which
|
||||
* satisfy the supplied predicate function. It passes each value to the supplied
|
||||
* predicate function, skipping elements while the predicate function returns
|
||||
* `true`. The predicate function is applied to one argument: *(value)*.
|
||||
*
|
||||
* Dispatches to the `dropWhile` method of the second argument, if present.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category List
|
||||
* @sig (a -> Boolean) -> [a] -> [a]
|
||||
* @sig (a -> Boolean) -> String -> String
|
||||
* @param {Function} fn The function called per iteration.
|
||||
* @param {Array} xs The collection to iterate over.
|
||||
* @return {Array} A new array.
|
||||
* @see R.takeWhile, R.transduce, R.addIndex
|
||||
* @example
|
||||
*
|
||||
* const lteTwo = x => x <= 2;
|
||||
*
|
||||
* R.dropWhile(lteTwo, [1, 2, 3, 4, 3, 2, 1]); //=> [3, 4, 3, 2, 1]
|
||||
*
|
||||
* R.dropWhile(x => x !== 'd' , 'Ramda'); //=> 'da'
|
||||
*/
|
||||
|
||||
var dropWhile =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable(['dropWhile'], _xdropWhile, function dropWhile(pred, xs) {
|
||||
var idx = 0;
|
||||
var len = xs.length;
|
||||
|
||||
while (idx < len && pred(xs[idx])) {
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return slice(idx, Infinity, xs);
|
||||
}));
|
||||
|
||||
export default dropWhile;
|
44
node_modules/ramda/es/either.js
generated
vendored
Normal file
44
node_modules/ramda/es/either.js
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _isFunction from "./internal/_isFunction.js";
|
||||
import lift from "./lift.js";
|
||||
import or from "./or.js";
|
||||
/**
|
||||
* A function wrapping calls to the two functions in an `||` operation,
|
||||
* returning the result of the first function if it is truth-y and the result
|
||||
* of the second function otherwise. Note that this is short-circuited,
|
||||
* meaning that the second function will not be invoked if the first returns a
|
||||
* truth-y value.
|
||||
*
|
||||
* In addition to functions, `R.either` also accepts any fantasy-land compatible
|
||||
* applicative functor.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.12.0
|
||||
* @category Logic
|
||||
* @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)
|
||||
* @param {Function} f a predicate
|
||||
* @param {Function} g another predicate
|
||||
* @return {Function} a function that applies its arguments to `f` and `g` and `||`s their outputs together.
|
||||
* @see R.or
|
||||
* @example
|
||||
*
|
||||
* const gt10 = x => x > 10;
|
||||
* const even = x => x % 2 === 0;
|
||||
* const f = R.either(gt10, even);
|
||||
* f(101); //=> true
|
||||
* f(8); //=> true
|
||||
*
|
||||
* R.either(Maybe.Just(false), Maybe.Just(55)); // => Maybe.Just(55)
|
||||
* R.either([false, false, 'a'], [11]) // => [11, 11, "a"]
|
||||
*/
|
||||
|
||||
var either =
|
||||
/*#__PURE__*/
|
||||
_curry2(function either(f, g) {
|
||||
return _isFunction(f) ? function _either() {
|
||||
return f.apply(this, arguments) || g.apply(this, arguments);
|
||||
} : lift(or)(f, g);
|
||||
});
|
||||
|
||||
export default either;
|
39
node_modules/ramda/es/empty.js
generated
vendored
Normal file
39
node_modules/ramda/es/empty.js
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import _isArguments from "./internal/_isArguments.js";
|
||||
import _isArray from "./internal/_isArray.js";
|
||||
import _isObject from "./internal/_isObject.js";
|
||||
import _isString from "./internal/_isString.js";
|
||||
/**
|
||||
* Returns the empty value of its argument's type. Ramda defines the empty
|
||||
* value of Array (`[]`), Object (`{}`), String (`''`), and Arguments. Other
|
||||
* types are supported if they define `<Type>.empty`,
|
||||
* `<Type>.prototype.empty` or implement the
|
||||
* [FantasyLand Monoid spec](https://github.com/fantasyland/fantasy-land#monoid).
|
||||
*
|
||||
* Dispatches to the `empty` method of the first argument, if present.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.3.0
|
||||
* @category Function
|
||||
* @sig a -> a
|
||||
* @param {*} x
|
||||
* @return {*}
|
||||
* @example
|
||||
*
|
||||
* R.empty(Just(42)); //=> Nothing()
|
||||
* R.empty([1, 2, 3]); //=> []
|
||||
* R.empty('unicorns'); //=> ''
|
||||
* R.empty({x: 1, y: 2}); //=> {}
|
||||
*/
|
||||
|
||||
var empty =
|
||||
/*#__PURE__*/
|
||||
_curry1(function empty(x) {
|
||||
return x != null && typeof x['fantasy-land/empty'] === 'function' ? x['fantasy-land/empty']() : x != null && x.constructor != null && typeof x.constructor['fantasy-land/empty'] === 'function' ? x.constructor['fantasy-land/empty']() : x != null && typeof x.empty === 'function' ? x.empty() : x != null && x.constructor != null && typeof x.constructor.empty === 'function' ? x.constructor.empty() : _isArray(x) ? [] : _isString(x) ? '' : _isObject(x) ? {} : _isArguments(x) ? function () {
|
||||
return arguments;
|
||||
}() : void 0 // else
|
||||
;
|
||||
});
|
||||
|
||||
export default empty;
|
33
node_modules/ramda/es/endsWith.js
generated
vendored
Normal file
33
node_modules/ramda/es/endsWith.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import equals from "./equals.js";
|
||||
import takeLast from "./takeLast.js";
|
||||
/**
|
||||
* Checks if a list ends with the provided sublist.
|
||||
*
|
||||
* Similarly, checks if a string ends with the provided substring.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.24.0
|
||||
* @category List
|
||||
* @sig [a] -> [a] -> Boolean
|
||||
* @sig String -> String -> Boolean
|
||||
* @param {*} suffix
|
||||
* @param {*} list
|
||||
* @return {Boolean}
|
||||
* @see R.startsWith
|
||||
* @example
|
||||
*
|
||||
* R.endsWith('c', 'abc') //=> true
|
||||
* R.endsWith('b', 'abc') //=> false
|
||||
* R.endsWith(['c'], ['a', 'b', 'c']) //=> true
|
||||
* R.endsWith(['b'], ['a', 'b', 'c']) //=> false
|
||||
*/
|
||||
|
||||
var endsWith =
|
||||
/*#__PURE__*/
|
||||
_curry2(function (suffix, list) {
|
||||
return equals(takeLast(suffix.length, list), suffix);
|
||||
});
|
||||
|
||||
export default endsWith;
|
27
node_modules/ramda/es/eqBy.js
generated
vendored
Normal file
27
node_modules/ramda/es/eqBy.js
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
import _curry3 from "./internal/_curry3.js";
|
||||
import equals from "./equals.js";
|
||||
/**
|
||||
* Takes a function and two values in its domain and returns `true` if the
|
||||
* values map to the same value in the codomain; `false` otherwise.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.18.0
|
||||
* @category Relation
|
||||
* @sig (a -> b) -> a -> a -> Boolean
|
||||
* @param {Function} f
|
||||
* @param {*} x
|
||||
* @param {*} y
|
||||
* @return {Boolean}
|
||||
* @example
|
||||
*
|
||||
* R.eqBy(Math.abs, 5, -5); //=> true
|
||||
*/
|
||||
|
||||
var eqBy =
|
||||
/*#__PURE__*/
|
||||
_curry3(function eqBy(f, x, y) {
|
||||
return equals(f(x), f(y));
|
||||
});
|
||||
|
||||
export default eqBy;
|
31
node_modules/ramda/es/eqProps.js
generated
vendored
Normal file
31
node_modules/ramda/es/eqProps.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
import _curry3 from "./internal/_curry3.js";
|
||||
import equals from "./equals.js";
|
||||
/**
|
||||
* Reports whether two objects have the same value, in [`R.equals`](#equals)
|
||||
* terms, for the specified property. Useful as a curried predicate.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Object
|
||||
* @sig k -> {k: v} -> {k: v} -> Boolean
|
||||
* @param {String} prop The name of the property to compare
|
||||
* @param {Object} obj1
|
||||
* @param {Object} obj2
|
||||
* @return {Boolean}
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* const o1 = { a: 1, b: 2, c: 3, d: 4 };
|
||||
* const o2 = { a: 10, b: 20, c: 3, d: 40 };
|
||||
* R.eqProps('a', o1, o2); //=> false
|
||||
* R.eqProps('c', o1, o2); //=> true
|
||||
*/
|
||||
|
||||
var eqProps =
|
||||
/*#__PURE__*/
|
||||
_curry3(function eqProps(prop, obj1, obj2) {
|
||||
return equals(obj1[prop], obj2[prop]);
|
||||
});
|
||||
|
||||
export default eqProps;
|
35
node_modules/ramda/es/equals.js
generated
vendored
Normal file
35
node_modules/ramda/es/equals.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _equals from "./internal/_equals.js";
|
||||
/**
|
||||
* Returns `true` if its arguments are equivalent, `false` otherwise. Handles
|
||||
* cyclical data structures.
|
||||
*
|
||||
* Dispatches symmetrically to the `equals` methods of both arguments, if
|
||||
* present.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.15.0
|
||||
* @category Relation
|
||||
* @sig a -> b -> Boolean
|
||||
* @param {*} a
|
||||
* @param {*} b
|
||||
* @return {Boolean}
|
||||
* @example
|
||||
*
|
||||
* R.equals(1, 1); //=> true
|
||||
* R.equals(1, '1'); //=> false
|
||||
* R.equals([1, 2, 3], [1, 2, 3]); //=> true
|
||||
*
|
||||
* const a = {}; a.v = a;
|
||||
* const b = {}; b.v = b;
|
||||
* R.equals(a, b); //=> true
|
||||
*/
|
||||
|
||||
var equals =
|
||||
/*#__PURE__*/
|
||||
_curry2(function equals(a, b) {
|
||||
return _equals(a, b, [], []);
|
||||
});
|
||||
|
||||
export default equals;
|
45
node_modules/ramda/es/evolve.js
generated
vendored
Normal file
45
node_modules/ramda/es/evolve.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Creates a new object by recursively evolving a shallow copy of `object`,
|
||||
* according to the `transformation` functions. All non-primitive properties
|
||||
* are copied by reference.
|
||||
*
|
||||
* A `transformation` function will not be invoked if its corresponding key
|
||||
* does not exist in the evolved object.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category Object
|
||||
* @sig {k: (v -> v)} -> {k: v} -> {k: v}
|
||||
* @param {Object} transformations The object specifying transformation functions to apply
|
||||
* to the object.
|
||||
* @param {Object} object The object to be transformed.
|
||||
* @return {Object} The transformed object.
|
||||
* @example
|
||||
*
|
||||
* const tomato = {firstName: ' Tomato ', data: {elapsed: 100, remaining: 1400}, id:123};
|
||||
* const transformations = {
|
||||
* firstName: R.trim,
|
||||
* lastName: R.trim, // Will not get invoked.
|
||||
* data: {elapsed: R.add(1), remaining: R.add(-1)}
|
||||
* };
|
||||
* R.evolve(transformations, tomato); //=> {firstName: 'Tomato', data: {elapsed: 101, remaining: 1399}, id:123}
|
||||
*/
|
||||
|
||||
var evolve =
|
||||
/*#__PURE__*/
|
||||
_curry2(function evolve(transformations, object) {
|
||||
var result = object instanceof Array ? [] : {};
|
||||
var transformation, key, type;
|
||||
|
||||
for (key in object) {
|
||||
transformation = transformations[key];
|
||||
type = typeof transformation;
|
||||
result[key] = type === 'function' ? transformation(object[key]) : transformation && type === 'object' ? evolve(transformation, object[key]) : object[key];
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
export default evolve;
|
51
node_modules/ramda/es/filter.js
generated
vendored
Normal file
51
node_modules/ramda/es/filter.js
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _filter from "./internal/_filter.js";
|
||||
import _isObject from "./internal/_isObject.js";
|
||||
import _reduce from "./internal/_reduce.js";
|
||||
import _xfilter from "./internal/_xfilter.js";
|
||||
import keys from "./keys.js";
|
||||
/**
|
||||
* Takes a predicate and a `Filterable`, and returns a new filterable of the
|
||||
* same type containing the members of the given filterable which satisfy the
|
||||
* given predicate. Filterable objects include plain objects or any object
|
||||
* that has a filter method such as `Array`.
|
||||
*
|
||||
* Dispatches to the `filter` method of the second argument, if present.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig Filterable f => (a -> Boolean) -> f a -> f a
|
||||
* @param {Function} pred
|
||||
* @param {Array} filterable
|
||||
* @return {Array} Filterable
|
||||
* @see R.reject, R.transduce, R.addIndex
|
||||
* @example
|
||||
*
|
||||
* const isEven = n => n % 2 === 0;
|
||||
*
|
||||
* R.filter(isEven, [1, 2, 3, 4]); //=> [2, 4]
|
||||
*
|
||||
* R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}
|
||||
*/
|
||||
|
||||
var filter =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable(['filter'], _xfilter, function (pred, filterable) {
|
||||
return _isObject(filterable) ? _reduce(function (acc, key) {
|
||||
if (pred(filterable[key])) {
|
||||
acc[key] = filterable[key];
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, {}, keys(filterable)) : // else
|
||||
_filter(pred, filterable);
|
||||
}));
|
||||
|
||||
export default filter;
|
46
node_modules/ramda/es/find.js
generated
vendored
Normal file
46
node_modules/ramda/es/find.js
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xfind from "./internal/_xfind.js";
|
||||
/**
|
||||
* Returns the first element of the list which matches the predicate, or
|
||||
* `undefined` if no element matches.
|
||||
*
|
||||
* Dispatches to the `find` method of the second argument, if present.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig (a -> Boolean) -> [a] -> a | undefined
|
||||
* @param {Function} fn The predicate function used to determine if the element is the
|
||||
* desired one.
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Object} The element found, or `undefined`.
|
||||
* @see R.transduce
|
||||
* @example
|
||||
*
|
||||
* const xs = [{a: 1}, {a: 2}, {a: 3}];
|
||||
* R.find(R.propEq('a', 2))(xs); //=> {a: 2}
|
||||
* R.find(R.propEq('a', 4))(xs); //=> undefined
|
||||
*/
|
||||
|
||||
var find =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable(['find'], _xfind, function find(fn, list) {
|
||||
var idx = 0;
|
||||
var len = list.length;
|
||||
|
||||
while (idx < len) {
|
||||
if (fn(list[idx])) {
|
||||
return list[idx];
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
}));
|
||||
|
||||
export default find;
|
46
node_modules/ramda/es/findIndex.js
generated
vendored
Normal file
46
node_modules/ramda/es/findIndex.js
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xfindIndex from "./internal/_xfindIndex.js";
|
||||
/**
|
||||
* Returns the index of the first element of the list which matches the
|
||||
* predicate, or `-1` if no element matches.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.1
|
||||
* @category List
|
||||
* @sig (a -> Boolean) -> [a] -> Number
|
||||
* @param {Function} fn The predicate function used to determine if the element is the
|
||||
* desired one.
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Number} The index of the element found, or `-1`.
|
||||
* @see R.transduce
|
||||
* @example
|
||||
*
|
||||
* const xs = [{a: 1}, {a: 2}, {a: 3}];
|
||||
* R.findIndex(R.propEq('a', 2))(xs); //=> 1
|
||||
* R.findIndex(R.propEq('a', 4))(xs); //=> -1
|
||||
*/
|
||||
|
||||
var findIndex =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable([], _xfindIndex, function findIndex(fn, list) {
|
||||
var idx = 0;
|
||||
var len = list.length;
|
||||
|
||||
while (idx < len) {
|
||||
if (fn(list[idx])) {
|
||||
return idx;
|
||||
}
|
||||
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}));
|
||||
|
||||
export default findIndex;
|
43
node_modules/ramda/es/findLast.js
generated
vendored
Normal file
43
node_modules/ramda/es/findLast.js
generated
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xfindLast from "./internal/_xfindLast.js";
|
||||
/**
|
||||
* Returns the last element of the list which matches the predicate, or
|
||||
* `undefined` if no element matches.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.1
|
||||
* @category List
|
||||
* @sig (a -> Boolean) -> [a] -> a | undefined
|
||||
* @param {Function} fn The predicate function used to determine if the element is the
|
||||
* desired one.
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Object} The element found, or `undefined`.
|
||||
* @see R.transduce
|
||||
* @example
|
||||
*
|
||||
* const xs = [{a: 1, b: 0}, {a:1, b: 1}];
|
||||
* R.findLast(R.propEq('a', 1))(xs); //=> {a: 1, b: 1}
|
||||
* R.findLast(R.propEq('a', 4))(xs); //=> undefined
|
||||
*/
|
||||
|
||||
var findLast =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable([], _xfindLast, function findLast(fn, list) {
|
||||
var idx = list.length - 1;
|
||||
|
||||
while (idx >= 0) {
|
||||
if (fn(list[idx])) {
|
||||
return list[idx];
|
||||
}
|
||||
|
||||
idx -= 1;
|
||||
}
|
||||
}));
|
||||
|
||||
export default findLast;
|
45
node_modules/ramda/es/findLastIndex.js
generated
vendored
Normal file
45
node_modules/ramda/es/findLastIndex.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _dispatchable from "./internal/_dispatchable.js";
|
||||
import _xfindLastIndex from "./internal/_xfindLastIndex.js";
|
||||
/**
|
||||
* Returns the index of the last element of the list which matches the
|
||||
* predicate, or `-1` if no element matches.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.1
|
||||
* @category List
|
||||
* @sig (a -> Boolean) -> [a] -> Number
|
||||
* @param {Function} fn The predicate function used to determine if the element is the
|
||||
* desired one.
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Number} The index of the element found, or `-1`.
|
||||
* @see R.transduce
|
||||
* @example
|
||||
*
|
||||
* const xs = [{a: 1, b: 0}, {a:1, b: 1}];
|
||||
* R.findLastIndex(R.propEq('a', 1))(xs); //=> 1
|
||||
* R.findLastIndex(R.propEq('a', 4))(xs); //=> -1
|
||||
*/
|
||||
|
||||
var findLastIndex =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_dispatchable([], _xfindLastIndex, function findLastIndex(fn, list) {
|
||||
var idx = list.length - 1;
|
||||
|
||||
while (idx >= 0) {
|
||||
if (fn(list[idx])) {
|
||||
return idx;
|
||||
}
|
||||
|
||||
idx -= 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}));
|
||||
|
||||
export default findLastIndex;
|
27
node_modules/ramda/es/flatten.js
generated
vendored
Normal file
27
node_modules/ramda/es/flatten.js
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import _makeFlat from "./internal/_makeFlat.js";
|
||||
/**
|
||||
* Returns a new list by pulling every item out of it (and all its sub-arrays)
|
||||
* and putting them in a new array, depth-first.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig [a] -> [b]
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Array} The flattened list.
|
||||
* @see R.unnest
|
||||
* @example
|
||||
*
|
||||
* R.flatten([1, 2, [3, 4], 5, [6, [7, 8, [9, [10, 11], 12]]]]);
|
||||
* //=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
||||
*/
|
||||
|
||||
var flatten =
|
||||
/*#__PURE__*/
|
||||
_curry1(
|
||||
/*#__PURE__*/
|
||||
_makeFlat(true));
|
||||
|
||||
export default flatten;
|
35
node_modules/ramda/es/flip.js
generated
vendored
Normal file
35
node_modules/ramda/es/flip.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import curryN from "./curryN.js";
|
||||
/**
|
||||
* Returns a new function much like the supplied one, except that the first two
|
||||
* arguments' order is reversed.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Function
|
||||
* @sig ((a, b, c, ...) -> z) -> (b -> a -> c -> ... -> z)
|
||||
* @param {Function} fn The function to invoke with its first two parameters reversed.
|
||||
* @return {*} The result of invoking `fn` with its first two parameters' order reversed.
|
||||
* @example
|
||||
*
|
||||
* const mergeThree = (a, b, c) => [].concat(a, b, c);
|
||||
*
|
||||
* mergeThree(1, 2, 3); //=> [1, 2, 3]
|
||||
*
|
||||
* R.flip(mergeThree)(1, 2, 3); //=> [2, 1, 3]
|
||||
* @symb R.flip(f)(a, b, c) = f(b, a, c)
|
||||
*/
|
||||
|
||||
var flip =
|
||||
/*#__PURE__*/
|
||||
_curry1(function flip(fn) {
|
||||
return curryN(fn.length, function (a, b) {
|
||||
var args = Array.prototype.slice.call(arguments, 0);
|
||||
args[0] = b;
|
||||
args[1] = a;
|
||||
return fn.apply(this, args);
|
||||
});
|
||||
});
|
||||
|
||||
export default flip;
|
54
node_modules/ramda/es/forEach.js
generated
vendored
Normal file
54
node_modules/ramda/es/forEach.js
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
import _checkForMethod from "./internal/_checkForMethod.js";
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Iterate over an input `list`, calling a provided function `fn` for each
|
||||
* element in the list.
|
||||
*
|
||||
* `fn` receives one argument: *(value)*.
|
||||
*
|
||||
* Note: `R.forEach` does not skip deleted or unassigned indices (sparse
|
||||
* arrays), unlike the native `Array.prototype.forEach` method. For more
|
||||
* details on this behavior, see:
|
||||
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Description
|
||||
*
|
||||
* Also note that, unlike `Array.prototype.forEach`, Ramda's `forEach` returns
|
||||
* the original array. In some libraries this function is named `each`.
|
||||
*
|
||||
* Dispatches to the `forEach` method of the second argument, if present.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.1
|
||||
* @category List
|
||||
* @sig (a -> *) -> [a] -> [a]
|
||||
* @param {Function} fn The function to invoke. Receives one argument, `value`.
|
||||
* @param {Array} list The list to iterate over.
|
||||
* @return {Array} The original list.
|
||||
* @see R.addIndex
|
||||
* @example
|
||||
*
|
||||
* const printXPlusFive = x => console.log(x + 5);
|
||||
* R.forEach(printXPlusFive, [1, 2, 3]); //=> [1, 2, 3]
|
||||
* // logs 6
|
||||
* // logs 7
|
||||
* // logs 8
|
||||
* @symb R.forEach(f, [a, b, c]) = [a, b, c]
|
||||
*/
|
||||
|
||||
var forEach =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_checkForMethod('forEach', function forEach(fn, list) {
|
||||
var len = list.length;
|
||||
var idx = 0;
|
||||
|
||||
while (idx < len) {
|
||||
fn(list[idx]);
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return list;
|
||||
}));
|
||||
|
||||
export default forEach;
|
41
node_modules/ramda/es/forEachObjIndexed.js
generated
vendored
Normal file
41
node_modules/ramda/es/forEachObjIndexed.js
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import keys from "./keys.js";
|
||||
/**
|
||||
* Iterate over an input `object`, calling a provided function `fn` for each
|
||||
* key and value in the object.
|
||||
*
|
||||
* `fn` receives three argument: *(value, key, obj)*.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.23.0
|
||||
* @category Object
|
||||
* @sig ((a, String, StrMap a) -> Any) -> StrMap a -> StrMap a
|
||||
* @param {Function} fn The function to invoke. Receives three argument, `value`, `key`, `obj`.
|
||||
* @param {Object} obj The object to iterate over.
|
||||
* @return {Object} The original object.
|
||||
* @example
|
||||
*
|
||||
* const printKeyConcatValue = (value, key) => console.log(key + ':' + value);
|
||||
* R.forEachObjIndexed(printKeyConcatValue, {x: 1, y: 2}); //=> {x: 1, y: 2}
|
||||
* // logs x:1
|
||||
* // logs y:2
|
||||
* @symb R.forEachObjIndexed(f, {x: a, y: b}) = {x: a, y: b}
|
||||
*/
|
||||
|
||||
var forEachObjIndexed =
|
||||
/*#__PURE__*/
|
||||
_curry2(function forEachObjIndexed(fn, obj) {
|
||||
var keyList = keys(obj);
|
||||
var idx = 0;
|
||||
|
||||
while (idx < keyList.length) {
|
||||
var key = keyList[idx];
|
||||
fn(obj[key], key, obj);
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return obj;
|
||||
});
|
||||
|
||||
export default forEachObjIndexed;
|
33
node_modules/ramda/es/fromPairs.js
generated
vendored
Normal file
33
node_modules/ramda/es/fromPairs.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
/**
|
||||
* Creates a new object from a list key-value pairs. If a key appears in
|
||||
* multiple pairs, the rightmost pair is included in the object.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.3.0
|
||||
* @category List
|
||||
* @sig [[k,v]] -> {k: v}
|
||||
* @param {Array} pairs An array of two-element arrays that will be the keys and values of the output object.
|
||||
* @return {Object} The object made by pairing up `keys` and `values`.
|
||||
* @see R.toPairs, R.pair
|
||||
* @example
|
||||
*
|
||||
* R.fromPairs([['a', 1], ['b', 2], ['c', 3]]); //=> {a: 1, b: 2, c: 3}
|
||||
*/
|
||||
|
||||
var fromPairs =
|
||||
/*#__PURE__*/
|
||||
_curry1(function fromPairs(pairs) {
|
||||
var result = {};
|
||||
var idx = 0;
|
||||
|
||||
while (idx < pairs.length) {
|
||||
result[pairs[idx][0]] = pairs[idx][1];
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
export default fromPairs;
|
60
node_modules/ramda/es/groupBy.js
generated
vendored
Normal file
60
node_modules/ramda/es/groupBy.js
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
import _checkForMethod from "./internal/_checkForMethod.js";
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
import reduceBy from "./reduceBy.js";
|
||||
/**
|
||||
* Splits a list into sub-lists stored in an object, based on the result of
|
||||
* calling a String-returning function on each element, and grouping the
|
||||
* results according to values returned.
|
||||
*
|
||||
* Dispatches to the `groupBy` method of the second argument, if present.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig (a -> String) -> [a] -> {String: [a]}
|
||||
* @param {Function} fn Function :: a -> String
|
||||
* @param {Array} list The array to group
|
||||
* @return {Object} An object with the output of `fn` for keys, mapped to arrays of elements
|
||||
* that produced that key when passed to `fn`.
|
||||
* @see R.reduceBy, R.transduce
|
||||
* @example
|
||||
*
|
||||
* const byGrade = R.groupBy(function(student) {
|
||||
* const score = student.score;
|
||||
* return score < 65 ? 'F' :
|
||||
* score < 70 ? 'D' :
|
||||
* score < 80 ? 'C' :
|
||||
* score < 90 ? 'B' : 'A';
|
||||
* });
|
||||
* const students = [{name: 'Abby', score: 84},
|
||||
* {name: 'Eddy', score: 58},
|
||||
* // ...
|
||||
* {name: 'Jack', score: 69}];
|
||||
* byGrade(students);
|
||||
* // {
|
||||
* // 'A': [{name: 'Dianne', score: 99}],
|
||||
* // 'B': [{name: 'Abby', score: 84}]
|
||||
* // // ...,
|
||||
* // 'F': [{name: 'Eddy', score: 58}]
|
||||
* // }
|
||||
*/
|
||||
|
||||
var groupBy =
|
||||
/*#__PURE__*/
|
||||
_curry2(
|
||||
/*#__PURE__*/
|
||||
_checkForMethod('groupBy',
|
||||
/*#__PURE__*/
|
||||
reduceBy(function (acc, item) {
|
||||
if (acc == null) {
|
||||
acc = [];
|
||||
}
|
||||
|
||||
acc.push(item);
|
||||
return acc;
|
||||
}, null)));
|
||||
|
||||
export default groupBy;
|
54
node_modules/ramda/es/groupWith.js
generated
vendored
Normal file
54
node_modules/ramda/es/groupWith.js
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Takes a list and returns a list of lists where each sublist's elements are
|
||||
* all satisfied pairwise comparison according to the provided function.
|
||||
* Only adjacent elements are passed to the comparison function.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.21.0
|
||||
* @category List
|
||||
* @sig ((a, a) → Boolean) → [a] → [[a]]
|
||||
* @param {Function} fn Function for determining whether two given (adjacent)
|
||||
* elements should be in the same group
|
||||
* @param {Array} list The array to group. Also accepts a string, which will be
|
||||
* treated as a list of characters.
|
||||
* @return {List} A list that contains sublists of elements,
|
||||
* whose concatenations are equal to the original list.
|
||||
* @example
|
||||
*
|
||||
* R.groupWith(R.equals, [0, 1, 1, 2, 3, 5, 8, 13, 21])
|
||||
* //=> [[0], [1, 1], [2], [3], [5], [8], [13], [21]]
|
||||
*
|
||||
* R.groupWith((a, b) => a + 1 === b, [0, 1, 1, 2, 3, 5, 8, 13, 21])
|
||||
* //=> [[0, 1], [1, 2, 3], [5], [8], [13], [21]]
|
||||
*
|
||||
* R.groupWith((a, b) => a % 2 === b % 2, [0, 1, 1, 2, 3, 5, 8, 13, 21])
|
||||
* //=> [[0], [1, 1], [2], [3, 5], [8], [13, 21]]
|
||||
*
|
||||
* R.groupWith(R.eqBy(isVowel), 'aestiou')
|
||||
* //=> ['ae', 'st', 'iou']
|
||||
*/
|
||||
|
||||
var groupWith =
|
||||
/*#__PURE__*/
|
||||
_curry2(function (fn, list) {
|
||||
var res = [];
|
||||
var idx = 0;
|
||||
var len = list.length;
|
||||
|
||||
while (idx < len) {
|
||||
var nextidx = idx + 1;
|
||||
|
||||
while (nextidx < len && fn(list[nextidx - 1], list[nextidx])) {
|
||||
nextidx += 1;
|
||||
}
|
||||
|
||||
res.push(list.slice(idx, nextidx));
|
||||
idx = nextidx;
|
||||
}
|
||||
|
||||
return res;
|
||||
});
|
||||
|
||||
export default groupWith;
|
30
node_modules/ramda/es/gt.js
generated
vendored
Normal file
30
node_modules/ramda/es/gt.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Returns `true` if the first argument is greater than the second; `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Relation
|
||||
* @sig Ord a => a -> a -> Boolean
|
||||
* @param {*} a
|
||||
* @param {*} b
|
||||
* @return {Boolean}
|
||||
* @see R.lt
|
||||
* @example
|
||||
*
|
||||
* R.gt(2, 1); //=> true
|
||||
* R.gt(2, 2); //=> false
|
||||
* R.gt(2, 3); //=> false
|
||||
* R.gt('a', 'z'); //=> false
|
||||
* R.gt('z', 'a'); //=> true
|
||||
*/
|
||||
|
||||
var gt =
|
||||
/*#__PURE__*/
|
||||
_curry2(function gt(a, b) {
|
||||
return a > b;
|
||||
});
|
||||
|
||||
export default gt;
|
30
node_modules/ramda/es/gte.js
generated
vendored
Normal file
30
node_modules/ramda/es/gte.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Returns `true` if the first argument is greater than or equal to the second;
|
||||
* `false` otherwise.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Relation
|
||||
* @sig Ord a => a -> a -> Boolean
|
||||
* @param {Number} a
|
||||
* @param {Number} b
|
||||
* @return {Boolean}
|
||||
* @see R.lte
|
||||
* @example
|
||||
*
|
||||
* R.gte(2, 1); //=> true
|
||||
* R.gte(2, 2); //=> true
|
||||
* R.gte(2, 3); //=> false
|
||||
* R.gte('a', 'z'); //=> false
|
||||
* R.gte('z', 'a'); //=> true
|
||||
*/
|
||||
|
||||
var gte =
|
||||
/*#__PURE__*/
|
||||
_curry2(function gte(a, b) {
|
||||
return a >= b;
|
||||
});
|
||||
|
||||
export default gte;
|
34
node_modules/ramda/es/has.js
generated
vendored
Normal file
34
node_modules/ramda/es/has.js
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import hasPath from "./hasPath.js";
|
||||
/**
|
||||
* Returns whether or not an object has an own property with the specified name
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.7.0
|
||||
* @category Object
|
||||
* @sig s -> {s: x} -> Boolean
|
||||
* @param {String} prop The name of the property to check for.
|
||||
* @param {Object} obj The object to query.
|
||||
* @return {Boolean} Whether the property exists.
|
||||
* @example
|
||||
*
|
||||
* const hasName = R.has('name');
|
||||
* hasName({name: 'alice'}); //=> true
|
||||
* hasName({name: 'bob'}); //=> true
|
||||
* hasName({}); //=> false
|
||||
*
|
||||
* const point = {x: 0, y: 0};
|
||||
* const pointHas = R.has(R.__, point);
|
||||
* pointHas('x'); //=> true
|
||||
* pointHas('y'); //=> true
|
||||
* pointHas('z'); //=> false
|
||||
*/
|
||||
|
||||
var has =
|
||||
/*#__PURE__*/
|
||||
_curry2(function has(prop, obj) {
|
||||
return hasPath([prop], obj);
|
||||
});
|
||||
|
||||
export default has;
|
35
node_modules/ramda/es/hasIn.js
generated
vendored
Normal file
35
node_modules/ramda/es/hasIn.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Returns whether or not an object or its prototype chain has a property with
|
||||
* the specified name
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.7.0
|
||||
* @category Object
|
||||
* @sig s -> {s: x} -> Boolean
|
||||
* @param {String} prop The name of the property to check for.
|
||||
* @param {Object} obj The object to query.
|
||||
* @return {Boolean} Whether the property exists.
|
||||
* @example
|
||||
*
|
||||
* function Rectangle(width, height) {
|
||||
* this.width = width;
|
||||
* this.height = height;
|
||||
* }
|
||||
* Rectangle.prototype.area = function() {
|
||||
* return this.width * this.height;
|
||||
* };
|
||||
*
|
||||
* const square = new Rectangle(2, 2);
|
||||
* R.hasIn('width', square); //=> true
|
||||
* R.hasIn('area', square); //=> true
|
||||
*/
|
||||
|
||||
var hasIn =
|
||||
/*#__PURE__*/
|
||||
_curry2(function hasIn(prop, obj) {
|
||||
return prop in obj;
|
||||
});
|
||||
|
||||
export default hasIn;
|
48
node_modules/ramda/es/hasPath.js
generated
vendored
Normal file
48
node_modules/ramda/es/hasPath.js
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _has from "./internal/_has.js";
|
||||
import isNil from "./isNil.js";
|
||||
/**
|
||||
* Returns whether or not a path exists in an object. Only the object's
|
||||
* own properties are checked.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.26.0
|
||||
* @category Object
|
||||
* @typedefn Idx = String | Int
|
||||
* @sig [Idx] -> {a} -> Boolean
|
||||
* @param {Array} path The path to use.
|
||||
* @param {Object} obj The object to check the path in.
|
||||
* @return {Boolean} Whether the path exists.
|
||||
* @see R.has
|
||||
* @example
|
||||
*
|
||||
* R.hasPath(['a', 'b'], {a: {b: 2}}); // => true
|
||||
* R.hasPath(['a', 'b'], {a: {b: undefined}}); // => true
|
||||
* R.hasPath(['a', 'b'], {a: {c: 2}}); // => false
|
||||
* R.hasPath(['a', 'b'], {}); // => false
|
||||
*/
|
||||
|
||||
var hasPath =
|
||||
/*#__PURE__*/
|
||||
_curry2(function hasPath(_path, obj) {
|
||||
if (_path.length === 0 || isNil(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var val = obj;
|
||||
var idx = 0;
|
||||
|
||||
while (idx < _path.length) {
|
||||
if (!isNil(val) && _has(_path[idx], val)) {
|
||||
val = val[_path[idx]];
|
||||
idx += 1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
export default hasPath;
|
27
node_modules/ramda/es/head.js
generated
vendored
Normal file
27
node_modules/ramda/es/head.js
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
import nth from "./nth.js";
|
||||
/**
|
||||
* Returns the first element of the given list or string. In some libraries
|
||||
* this function is named `first`.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig [a] -> a | Undefined
|
||||
* @sig String -> String
|
||||
* @param {Array|String} list
|
||||
* @return {*}
|
||||
* @see R.tail, R.init, R.last
|
||||
* @example
|
||||
*
|
||||
* R.head(['fi', 'fo', 'fum']); //=> 'fi'
|
||||
* R.head([]); //=> undefined
|
||||
*
|
||||
* R.head('abc'); //=> 'a'
|
||||
* R.head(''); //=> ''
|
||||
*/
|
||||
|
||||
var head =
|
||||
/*#__PURE__*/
|
||||
nth(0);
|
||||
export default head;
|
33
node_modules/ramda/es/identical.js
generated
vendored
Normal file
33
node_modules/ramda/es/identical.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
import _objectIs from "./internal/_objectIs.js";
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Returns true if its arguments are identical, false otherwise. Values are
|
||||
* identical if they reference the same memory. `NaN` is identical to `NaN`;
|
||||
* `0` and `-0` are not identical.
|
||||
*
|
||||
* Note this is merely a curried version of ES6 `Object.is`.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.15.0
|
||||
* @category Relation
|
||||
* @sig a -> a -> Boolean
|
||||
* @param {*} a
|
||||
* @param {*} b
|
||||
* @return {Boolean}
|
||||
* @example
|
||||
*
|
||||
* const o = {};
|
||||
* R.identical(o, o); //=> true
|
||||
* R.identical(1, 1); //=> true
|
||||
* R.identical(1, '1'); //=> false
|
||||
* R.identical([], []); //=> false
|
||||
* R.identical(0, -0); //=> false
|
||||
* R.identical(NaN, NaN); //=> true
|
||||
*/
|
||||
|
||||
var identical =
|
||||
/*#__PURE__*/
|
||||
_curry2(_objectIs);
|
||||
|
||||
export default identical;
|
27
node_modules/ramda/es/identity.js
generated
vendored
Normal file
27
node_modules/ramda/es/identity.js
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
import _curry1 from "./internal/_curry1.js";
|
||||
import _identity from "./internal/_identity.js";
|
||||
/**
|
||||
* A function that does nothing but return the parameter supplied to it. Good
|
||||
* as a default or placeholder function.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Function
|
||||
* @sig a -> a
|
||||
* @param {*} x The value to return.
|
||||
* @return {*} The input value, `x`.
|
||||
* @example
|
||||
*
|
||||
* R.identity(1); //=> 1
|
||||
*
|
||||
* const obj = {};
|
||||
* R.identity(obj) === obj; //=> true
|
||||
* @symb R.identity(a) = a
|
||||
*/
|
||||
|
||||
var identity =
|
||||
/*#__PURE__*/
|
||||
_curry1(_identity);
|
||||
|
||||
export default identity;
|
37
node_modules/ramda/es/ifElse.js
generated
vendored
Normal file
37
node_modules/ramda/es/ifElse.js
generated
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
import _curry3 from "./internal/_curry3.js";
|
||||
import curryN from "./curryN.js";
|
||||
/**
|
||||
* Creates a function that will process either the `onTrue` or the `onFalse`
|
||||
* function depending upon the result of the `condition` predicate.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.8.0
|
||||
* @category Logic
|
||||
* @sig (*... -> Boolean) -> (*... -> *) -> (*... -> *) -> (*... -> *)
|
||||
* @param {Function} condition A predicate function
|
||||
* @param {Function} onTrue A function to invoke when the `condition` evaluates to a truthy value.
|
||||
* @param {Function} onFalse A function to invoke when the `condition` evaluates to a falsy value.
|
||||
* @return {Function} A new function that will process either the `onTrue` or the `onFalse`
|
||||
* function depending upon the result of the `condition` predicate.
|
||||
* @see R.unless, R.when, R.cond
|
||||
* @example
|
||||
*
|
||||
* const incCount = R.ifElse(
|
||||
* R.has('count'),
|
||||
* R.over(R.lensProp('count'), R.inc),
|
||||
* R.assoc('count', 1)
|
||||
* );
|
||||
* incCount({}); //=> { count: 1 }
|
||||
* incCount({ count: 1 }); //=> { count: 2 }
|
||||
*/
|
||||
|
||||
var ifElse =
|
||||
/*#__PURE__*/
|
||||
_curry3(function ifElse(condition, onTrue, onFalse) {
|
||||
return curryN(Math.max(condition.length, onTrue.length, onFalse.length), function _ifElse() {
|
||||
return condition.apply(this, arguments) ? onTrue.apply(this, arguments) : onFalse.apply(this, arguments);
|
||||
});
|
||||
});
|
||||
|
||||
export default ifElse;
|
21
node_modules/ramda/es/inc.js
generated
vendored
Normal file
21
node_modules/ramda/es/inc.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
import add from "./add.js";
|
||||
/**
|
||||
* Increments its argument.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category Math
|
||||
* @sig Number -> Number
|
||||
* @param {Number} n
|
||||
* @return {Number} n + 1
|
||||
* @see R.dec
|
||||
* @example
|
||||
*
|
||||
* R.inc(42); //=> 43
|
||||
*/
|
||||
|
||||
var inc =
|
||||
/*#__PURE__*/
|
||||
add(1);
|
||||
export default inc;
|
30
node_modules/ramda/es/includes.js
generated
vendored
Normal file
30
node_modules/ramda/es/includes.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
import _includes from "./internal/_includes.js";
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Returns `true` if the specified value is equal, in [`R.equals`](#equals)
|
||||
* terms, to at least one element of the given list; `false` otherwise.
|
||||
* Works also with strings.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.26.0
|
||||
* @category List
|
||||
* @sig a -> [a] -> Boolean
|
||||
* @param {Object} a The item to compare against.
|
||||
* @param {Array} list The array to consider.
|
||||
* @return {Boolean} `true` if an equivalent item is in the list, `false` otherwise.
|
||||
* @see R.any
|
||||
* @example
|
||||
*
|
||||
* R.includes(3, [1, 2, 3]); //=> true
|
||||
* R.includes(4, [1, 2, 3]); //=> false
|
||||
* R.includes({ name: 'Fred' }, [{ name: 'Fred' }]); //=> true
|
||||
* R.includes([42], [[42]]); //=> true
|
||||
* R.includes('ba', 'banana'); //=>true
|
||||
*/
|
||||
|
||||
var includes =
|
||||
/*#__PURE__*/
|
||||
_curry2(_includes);
|
||||
|
||||
export default includes;
|
257
node_modules/ramda/es/index.js
generated
vendored
Normal file
257
node_modules/ramda/es/index.js
generated
vendored
Normal file
|
@ -0,0 +1,257 @@
|
|||
export { default as F } from "./F.js";
|
||||
export { default as T } from "./T.js";
|
||||
export { default as __ } from "./__.js";
|
||||
export { default as add } from "./add.js";
|
||||
export { default as addIndex } from "./addIndex.js";
|
||||
export { default as adjust } from "./adjust.js";
|
||||
export { default as all } from "./all.js";
|
||||
export { default as allPass } from "./allPass.js";
|
||||
export { default as always } from "./always.js";
|
||||
export { default as and } from "./and.js";
|
||||
export { default as any } from "./any.js";
|
||||
export { default as anyPass } from "./anyPass.js";
|
||||
export { default as ap } from "./ap.js";
|
||||
export { default as aperture } from "./aperture.js";
|
||||
export { default as append } from "./append.js";
|
||||
export { default as apply } from "./apply.js";
|
||||
export { default as applySpec } from "./applySpec.js";
|
||||
export { default as applyTo } from "./applyTo.js";
|
||||
export { default as ascend } from "./ascend.js";
|
||||
export { default as assoc } from "./assoc.js";
|
||||
export { default as assocPath } from "./assocPath.js";
|
||||
export { default as binary } from "./binary.js";
|
||||
export { default as bind } from "./bind.js";
|
||||
export { default as both } from "./both.js";
|
||||
export { default as call } from "./call.js";
|
||||
export { default as chain } from "./chain.js";
|
||||
export { default as clamp } from "./clamp.js";
|
||||
export { default as clone } from "./clone.js";
|
||||
export { default as comparator } from "./comparator.js";
|
||||
export { default as complement } from "./complement.js";
|
||||
export { default as compose } from "./compose.js";
|
||||
export { default as composeK } from "./composeK.js";
|
||||
export { default as composeP } from "./composeP.js";
|
||||
export { default as composeWith } from "./composeWith.js";
|
||||
export { default as concat } from "./concat.js";
|
||||
export { default as cond } from "./cond.js";
|
||||
export { default as construct } from "./construct.js";
|
||||
export { default as constructN } from "./constructN.js";
|
||||
export { default as contains } from "./contains.js";
|
||||
export { default as converge } from "./converge.js";
|
||||
export { default as countBy } from "./countBy.js";
|
||||
export { default as curry } from "./curry.js";
|
||||
export { default as curryN } from "./curryN.js";
|
||||
export { default as dec } from "./dec.js";
|
||||
export { default as defaultTo } from "./defaultTo.js";
|
||||
export { default as descend } from "./descend.js";
|
||||
export { default as difference } from "./difference.js";
|
||||
export { default as differenceWith } from "./differenceWith.js";
|
||||
export { default as dissoc } from "./dissoc.js";
|
||||
export { default as dissocPath } from "./dissocPath.js";
|
||||
export { default as divide } from "./divide.js";
|
||||
export { default as drop } from "./drop.js";
|
||||
export { default as dropLast } from "./dropLast.js";
|
||||
export { default as dropLastWhile } from "./dropLastWhile.js";
|
||||
export { default as dropRepeats } from "./dropRepeats.js";
|
||||
export { default as dropRepeatsWith } from "./dropRepeatsWith.js";
|
||||
export { default as dropWhile } from "./dropWhile.js";
|
||||
export { default as either } from "./either.js";
|
||||
export { default as empty } from "./empty.js";
|
||||
export { default as endsWith } from "./endsWith.js";
|
||||
export { default as eqBy } from "./eqBy.js";
|
||||
export { default as eqProps } from "./eqProps.js";
|
||||
export { default as equals } from "./equals.js";
|
||||
export { default as evolve } from "./evolve.js";
|
||||
export { default as filter } from "./filter.js";
|
||||
export { default as find } from "./find.js";
|
||||
export { default as findIndex } from "./findIndex.js";
|
||||
export { default as findLast } from "./findLast.js";
|
||||
export { default as findLastIndex } from "./findLastIndex.js";
|
||||
export { default as flatten } from "./flatten.js";
|
||||
export { default as flip } from "./flip.js";
|
||||
export { default as forEach } from "./forEach.js";
|
||||
export { default as forEachObjIndexed } from "./forEachObjIndexed.js";
|
||||
export { default as fromPairs } from "./fromPairs.js";
|
||||
export { default as groupBy } from "./groupBy.js";
|
||||
export { default as groupWith } from "./groupWith.js";
|
||||
export { default as gt } from "./gt.js";
|
||||
export { default as gte } from "./gte.js";
|
||||
export { default as has } from "./has.js";
|
||||
export { default as hasIn } from "./hasIn.js";
|
||||
export { default as hasPath } from "./hasPath.js";
|
||||
export { default as head } from "./head.js";
|
||||
export { default as identical } from "./identical.js";
|
||||
export { default as identity } from "./identity.js";
|
||||
export { default as ifElse } from "./ifElse.js";
|
||||
export { default as inc } from "./inc.js";
|
||||
export { default as includes } from "./includes.js";
|
||||
export { default as indexBy } from "./indexBy.js";
|
||||
export { default as indexOf } from "./indexOf.js";
|
||||
export { default as init } from "./init.js";
|
||||
export { default as innerJoin } from "./innerJoin.js";
|
||||
export { default as insert } from "./insert.js";
|
||||
export { default as insertAll } from "./insertAll.js";
|
||||
export { default as intersection } from "./intersection.js";
|
||||
export { default as intersperse } from "./intersperse.js";
|
||||
export { default as into } from "./into.js";
|
||||
export { default as invert } from "./invert.js";
|
||||
export { default as invertObj } from "./invertObj.js";
|
||||
export { default as invoker } from "./invoker.js";
|
||||
export { default as is } from "./is.js";
|
||||
export { default as isEmpty } from "./isEmpty.js";
|
||||
export { default as isNil } from "./isNil.js";
|
||||
export { default as join } from "./join.js";
|
||||
export { default as juxt } from "./juxt.js";
|
||||
export { default as keys } from "./keys.js";
|
||||
export { default as keysIn } from "./keysIn.js";
|
||||
export { default as last } from "./last.js";
|
||||
export { default as lastIndexOf } from "./lastIndexOf.js";
|
||||
export { default as length } from "./length.js";
|
||||
export { default as lens } from "./lens.js";
|
||||
export { default as lensIndex } from "./lensIndex.js";
|
||||
export { default as lensPath } from "./lensPath.js";
|
||||
export { default as lensProp } from "./lensProp.js";
|
||||
export { default as lift } from "./lift.js";
|
||||
export { default as liftN } from "./liftN.js";
|
||||
export { default as lt } from "./lt.js";
|
||||
export { default as lte } from "./lte.js";
|
||||
export { default as map } from "./map.js";
|
||||
export { default as mapAccum } from "./mapAccum.js";
|
||||
export { default as mapAccumRight } from "./mapAccumRight.js";
|
||||
export { default as mapObjIndexed } from "./mapObjIndexed.js";
|
||||
export { default as match } from "./match.js";
|
||||
export { default as mathMod } from "./mathMod.js";
|
||||
export { default as max } from "./max.js";
|
||||
export { default as maxBy } from "./maxBy.js";
|
||||
export { default as mean } from "./mean.js";
|
||||
export { default as median } from "./median.js";
|
||||
export { default as memoizeWith } from "./memoizeWith.js";
|
||||
export { default as merge } from "./merge.js";
|
||||
export { default as mergeAll } from "./mergeAll.js";
|
||||
export { default as mergeDeepLeft } from "./mergeDeepLeft.js";
|
||||
export { default as mergeDeepRight } from "./mergeDeepRight.js";
|
||||
export { default as mergeDeepWith } from "./mergeDeepWith.js";
|
||||
export { default as mergeDeepWithKey } from "./mergeDeepWithKey.js";
|
||||
export { default as mergeLeft } from "./mergeLeft.js";
|
||||
export { default as mergeRight } from "./mergeRight.js";
|
||||
export { default as mergeWith } from "./mergeWith.js";
|
||||
export { default as mergeWithKey } from "./mergeWithKey.js";
|
||||
export { default as min } from "./min.js";
|
||||
export { default as minBy } from "./minBy.js";
|
||||
export { default as modulo } from "./modulo.js";
|
||||
export { default as move } from "./move.js";
|
||||
export { default as multiply } from "./multiply.js";
|
||||
export { default as nAry } from "./nAry.js";
|
||||
export { default as negate } from "./negate.js";
|
||||
export { default as none } from "./none.js";
|
||||
export { default as not } from "./not.js";
|
||||
export { default as nth } from "./nth.js";
|
||||
export { default as nthArg } from "./nthArg.js";
|
||||
export { default as o } from "./o.js";
|
||||
export { default as objOf } from "./objOf.js";
|
||||
export { default as of } from "./of.js";
|
||||
export { default as omit } from "./omit.js";
|
||||
export { default as once } from "./once.js";
|
||||
export { default as or } from "./or.js";
|
||||
export { default as otherwise } from "./otherwise.js";
|
||||
export { default as over } from "./over.js";
|
||||
export { default as pair } from "./pair.js";
|
||||
export { default as partial } from "./partial.js";
|
||||
export { default as partialRight } from "./partialRight.js";
|
||||
export { default as partition } from "./partition.js";
|
||||
export { default as path } from "./path.js";
|
||||
export { default as paths } from "./paths.js";
|
||||
export { default as pathEq } from "./pathEq.js";
|
||||
export { default as pathOr } from "./pathOr.js";
|
||||
export { default as pathSatisfies } from "./pathSatisfies.js";
|
||||
export { default as pick } from "./pick.js";
|
||||
export { default as pickAll } from "./pickAll.js";
|
||||
export { default as pickBy } from "./pickBy.js";
|
||||
export { default as pipe } from "./pipe.js";
|
||||
export { default as pipeK } from "./pipeK.js";
|
||||
export { default as pipeP } from "./pipeP.js";
|
||||
export { default as pipeWith } from "./pipeWith.js";
|
||||
export { default as pluck } from "./pluck.js";
|
||||
export { default as prepend } from "./prepend.js";
|
||||
export { default as product } from "./product.js";
|
||||
export { default as project } from "./project.js";
|
||||
export { default as prop } from "./prop.js";
|
||||
export { default as propEq } from "./propEq.js";
|
||||
export { default as propIs } from "./propIs.js";
|
||||
export { default as propOr } from "./propOr.js";
|
||||
export { default as propSatisfies } from "./propSatisfies.js";
|
||||
export { default as props } from "./props.js";
|
||||
export { default as range } from "./range.js";
|
||||
export { default as reduce } from "./reduce.js";
|
||||
export { default as reduceBy } from "./reduceBy.js";
|
||||
export { default as reduceRight } from "./reduceRight.js";
|
||||
export { default as reduceWhile } from "./reduceWhile.js";
|
||||
export { default as reduced } from "./reduced.js";
|
||||
export { default as reject } from "./reject.js";
|
||||
export { default as remove } from "./remove.js";
|
||||
export { default as repeat } from "./repeat.js";
|
||||
export { default as replace } from "./replace.js";
|
||||
export { default as reverse } from "./reverse.js";
|
||||
export { default as scan } from "./scan.js";
|
||||
export { default as sequence } from "./sequence.js";
|
||||
export { default as set } from "./set.js";
|
||||
export { default as slice } from "./slice.js";
|
||||
export { default as sort } from "./sort.js";
|
||||
export { default as sortBy } from "./sortBy.js";
|
||||
export { default as sortWith } from "./sortWith.js";
|
||||
export { default as split } from "./split.js";
|
||||
export { default as splitAt } from "./splitAt.js";
|
||||
export { default as splitEvery } from "./splitEvery.js";
|
||||
export { default as splitWhen } from "./splitWhen.js";
|
||||
export { default as startsWith } from "./startsWith.js";
|
||||
export { default as subtract } from "./subtract.js";
|
||||
export { default as sum } from "./sum.js";
|
||||
export { default as symmetricDifference } from "./symmetricDifference.js";
|
||||
export { default as symmetricDifferenceWith } from "./symmetricDifferenceWith.js";
|
||||
export { default as tail } from "./tail.js";
|
||||
export { default as take } from "./take.js";
|
||||
export { default as takeLast } from "./takeLast.js";
|
||||
export { default as takeLastWhile } from "./takeLastWhile.js";
|
||||
export { default as takeWhile } from "./takeWhile.js";
|
||||
export { default as tap } from "./tap.js";
|
||||
export { default as test } from "./test.js";
|
||||
export { default as andThen } from "./andThen.js";
|
||||
export { default as times } from "./times.js";
|
||||
export { default as toLower } from "./toLower.js";
|
||||
export { default as toPairs } from "./toPairs.js";
|
||||
export { default as toPairsIn } from "./toPairsIn.js";
|
||||
export { default as toString } from "./toString.js";
|
||||
export { default as toUpper } from "./toUpper.js";
|
||||
export { default as transduce } from "./transduce.js";
|
||||
export { default as transpose } from "./transpose.js";
|
||||
export { default as traverse } from "./traverse.js";
|
||||
export { default as trim } from "./trim.js";
|
||||
export { default as tryCatch } from "./tryCatch.js";
|
||||
export { default as type } from "./type.js";
|
||||
export { default as unapply } from "./unapply.js";
|
||||
export { default as unary } from "./unary.js";
|
||||
export { default as uncurryN } from "./uncurryN.js";
|
||||
export { default as unfold } from "./unfold.js";
|
||||
export { default as union } from "./union.js";
|
||||
export { default as unionWith } from "./unionWith.js";
|
||||
export { default as uniq } from "./uniq.js";
|
||||
export { default as uniqBy } from "./uniqBy.js";
|
||||
export { default as uniqWith } from "./uniqWith.js";
|
||||
export { default as unless } from "./unless.js";
|
||||
export { default as unnest } from "./unnest.js";
|
||||
export { default as until } from "./until.js";
|
||||
export { default as update } from "./update.js";
|
||||
export { default as useWith } from "./useWith.js";
|
||||
export { default as values } from "./values.js";
|
||||
export { default as valuesIn } from "./valuesIn.js";
|
||||
export { default as view } from "./view.js";
|
||||
export { default as when } from "./when.js";
|
||||
export { default as where } from "./where.js";
|
||||
export { default as whereEq } from "./whereEq.js";
|
||||
export { default as without } from "./without.js";
|
||||
export { default as xor } from "./xor.js";
|
||||
export { default as xprod } from "./xprod.js";
|
||||
export { default as zip } from "./zip.js";
|
||||
export { default as zipObj } from "./zipObj.js";
|
||||
export { default as zipWith } from "./zipWith.js";
|
||||
export { default as thunkify } from "./thunkify.js";
|
30
node_modules/ramda/es/indexBy.js
generated
vendored
Normal file
30
node_modules/ramda/es/indexBy.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
import reduceBy from "./reduceBy.js";
|
||||
/**
|
||||
* Given a function that generates a key, turns a list of objects into an
|
||||
* object indexing the objects by the given key. Note that if multiple
|
||||
* objects generate the same value for the indexing key only the last value
|
||||
* will be included in the generated object.
|
||||
*
|
||||
* Acts as a transducer if a transformer is given in list position.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.19.0
|
||||
* @category List
|
||||
* @sig (a -> String) -> [{k: v}] -> {k: {k: v}}
|
||||
* @param {Function} fn Function :: a -> String
|
||||
* @param {Array} array The array of objects to index
|
||||
* @return {Object} An object indexing each array element by the given property.
|
||||
* @example
|
||||
*
|
||||
* const list = [{id: 'xyz', title: 'A'}, {id: 'abc', title: 'B'}];
|
||||
* R.indexBy(R.prop('id'), list);
|
||||
* //=> {abc: {id: 'abc', title: 'B'}, xyz: {id: 'xyz', title: 'A'}}
|
||||
*/
|
||||
|
||||
var indexBy =
|
||||
/*#__PURE__*/
|
||||
reduceBy(function (acc, elem) {
|
||||
return elem;
|
||||
}, null);
|
||||
export default indexBy;
|
30
node_modules/ramda/es/indexOf.js
generated
vendored
Normal file
30
node_modules/ramda/es/indexOf.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
import _curry2 from "./internal/_curry2.js";
|
||||
import _indexOf from "./internal/_indexOf.js";
|
||||
import _isArray from "./internal/_isArray.js";
|
||||
/**
|
||||
* Returns the position of the first occurrence of an item in an array, or -1
|
||||
* if the item is not included in the array. [`R.equals`](#equals) is used to
|
||||
* determine equality.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category List
|
||||
* @sig a -> [a] -> Number
|
||||
* @param {*} target The item to find.
|
||||
* @param {Array} xs The array to search in.
|
||||
* @return {Number} the index of the target, or -1 if the target is not found.
|
||||
* @see R.lastIndexOf
|
||||
* @example
|
||||
*
|
||||
* R.indexOf(3, [1,2,3,4]); //=> 2
|
||||
* R.indexOf(10, [1,2,3,4]); //=> -1
|
||||
*/
|
||||
|
||||
var indexOf =
|
||||
/*#__PURE__*/
|
||||
_curry2(function indexOf(target, xs) {
|
||||
return typeof xs.indexOf === 'function' && !_isArray(xs) ? xs.indexOf(target) : _indexOf(xs, target, 0);
|
||||
});
|
||||
|
||||
export default indexOf;
|
30
node_modules/ramda/es/init.js
generated
vendored
Normal file
30
node_modules/ramda/es/init.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
import slice from "./slice.js";
|
||||
/**
|
||||
* Returns all but the last element of the given list or string.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category List
|
||||
* @sig [a] -> [a]
|
||||
* @sig String -> String
|
||||
* @param {*} list
|
||||
* @return {*}
|
||||
* @see R.last, R.head, R.tail
|
||||
* @example
|
||||
*
|
||||
* R.init([1, 2, 3]); //=> [1, 2]
|
||||
* R.init([1, 2]); //=> [1]
|
||||
* R.init([1]); //=> []
|
||||
* R.init([]); //=> []
|
||||
*
|
||||
* R.init('abc'); //=> 'ab'
|
||||
* R.init('ab'); //=> 'a'
|
||||
* R.init('a'); //=> ''
|
||||
* R.init(''); //=> ''
|
||||
*/
|
||||
|
||||
var init =
|
||||
/*#__PURE__*/
|
||||
slice(0, -1);
|
||||
export default init;
|
48
node_modules/ramda/es/innerJoin.js
generated
vendored
Normal file
48
node_modules/ramda/es/innerJoin.js
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
import _includesWith from "./internal/_includesWith.js";
|
||||
import _curry3 from "./internal/_curry3.js";
|
||||
import _filter from "./internal/_filter.js";
|
||||
/**
|
||||
* Takes a predicate `pred`, a list `xs`, and a list `ys`, and returns a list
|
||||
* `xs'` comprising each of the elements of `xs` which is equal to one or more
|
||||
* elements of `ys` according to `pred`.
|
||||
*
|
||||
* `pred` must be a binary function expecting an element from each list.
|
||||
*
|
||||
* `xs`, `ys`, and `xs'` are treated as sets, semantically, so ordering should
|
||||
* not be significant, but since `xs'` is ordered the implementation guarantees
|
||||
* that its values are in the same order as they appear in `xs`. Duplicates are
|
||||
* not removed, so `xs'` may contain duplicates if `xs` contains duplicates.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.24.0
|
||||
* @category Relation
|
||||
* @sig ((a, b) -> Boolean) -> [a] -> [b] -> [a]
|
||||
* @param {Function} pred
|
||||
* @param {Array} xs
|
||||
* @param {Array} ys
|
||||
* @return {Array}
|
||||
* @see R.intersection
|
||||
* @example
|
||||
*
|
||||
* R.innerJoin(
|
||||
* (record, id) => record.id === id,
|
||||
* [{id: 824, name: 'Richie Furay'},
|
||||
* {id: 956, name: 'Dewey Martin'},
|
||||
* {id: 313, name: 'Bruce Palmer'},
|
||||
* {id: 456, name: 'Stephen Stills'},
|
||||
* {id: 177, name: 'Neil Young'}],
|
||||
* [177, 456, 999]
|
||||
* );
|
||||
* //=> [{id: 456, name: 'Stephen Stills'}, {id: 177, name: 'Neil Young'}]
|
||||
*/
|
||||
|
||||
var innerJoin =
|
||||
/*#__PURE__*/
|
||||
_curry3(function innerJoin(pred, xs, ys) {
|
||||
return _filter(function (x) {
|
||||
return _includesWith(pred, x, ys);
|
||||
}, xs);
|
||||
});
|
||||
|
||||
export default innerJoin;
|
31
node_modules/ramda/es/insert.js
generated
vendored
Normal file
31
node_modules/ramda/es/insert.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
import _curry3 from "./internal/_curry3.js";
|
||||
/**
|
||||
* Inserts the supplied element into the list, at the specified `index`. _Note that
|
||||
|
||||
* this is not destructive_: it returns a copy of the list with the changes.
|
||||
* <small>No lists have been harmed in the application of this function.</small>
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.2.2
|
||||
* @category List
|
||||
* @sig Number -> a -> [a] -> [a]
|
||||
* @param {Number} index The position to insert the element
|
||||
* @param {*} elt The element to insert into the Array
|
||||
* @param {Array} list The list to insert into
|
||||
* @return {Array} A new Array with `elt` inserted at `index`.
|
||||
* @example
|
||||
*
|
||||
* R.insert(2, 'x', [1,2,3,4]); //=> [1,2,'x',3,4]
|
||||
*/
|
||||
|
||||
var insert =
|
||||
/*#__PURE__*/
|
||||
_curry3(function insert(idx, elt, list) {
|
||||
idx = idx < list.length && idx >= 0 ? idx : list.length;
|
||||
var result = Array.prototype.slice.call(list, 0);
|
||||
result.splice(idx, 0, elt);
|
||||
return result;
|
||||
});
|
||||
|
||||
export default insert;
|
28
node_modules/ramda/es/insertAll.js
generated
vendored
Normal file
28
node_modules/ramda/es/insertAll.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
import _curry3 from "./internal/_curry3.js";
|
||||
/**
|
||||
* Inserts the sub-list into the list, at the specified `index`. _Note that this is not
|
||||
* destructive_: it returns a copy of the list with the changes.
|
||||
* <small>No lists have been harmed in the application of this function.</small>
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.9.0
|
||||
* @category List
|
||||
* @sig Number -> [a] -> [a] -> [a]
|
||||
* @param {Number} index The position to insert the sub-list
|
||||
* @param {Array} elts The sub-list to insert into the Array
|
||||
* @param {Array} list The list to insert the sub-list into
|
||||
* @return {Array} A new Array with `elts` inserted starting at `index`.
|
||||
* @example
|
||||
*
|
||||
* R.insertAll(2, ['x','y','z'], [1,2,3,4]); //=> [1,2,'x','y','z',3,4]
|
||||
*/
|
||||
|
||||
var insertAll =
|
||||
/*#__PURE__*/
|
||||
_curry3(function insertAll(idx, elts, list) {
|
||||
idx = idx < list.length && idx >= 0 ? idx : list.length;
|
||||
return [].concat(Array.prototype.slice.call(list, 0, idx), elts, Array.prototype.slice.call(list, idx));
|
||||
});
|
||||
|
||||
export default insertAll;
|
201
node_modules/ramda/es/internal/_Set.js
generated
vendored
Normal file
201
node_modules/ramda/es/internal/_Set.js
generated
vendored
Normal file
|
@ -0,0 +1,201 @@
|
|||
import _includes from "./_includes.js";
|
||||
|
||||
var _Set =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function _Set() {
|
||||
/* globals Set */
|
||||
this._nativeSet = typeof Set === 'function' ? new Set() : null;
|
||||
this._items = {};
|
||||
}
|
||||
|
||||
// until we figure out why jsdoc chokes on this
|
||||
// @param item The item to add to the Set
|
||||
// @returns {boolean} true if the item did not exist prior, otherwise false
|
||||
//
|
||||
_Set.prototype.add = function (item) {
|
||||
return !hasOrAdd(item, true, this);
|
||||
}; //
|
||||
// @param item The item to check for existence in the Set
|
||||
// @returns {boolean} true if the item exists in the Set, otherwise false
|
||||
//
|
||||
|
||||
|
||||
_Set.prototype.has = function (item) {
|
||||
return hasOrAdd(item, false, this);
|
||||
}; //
|
||||
// Combines the logic for checking whether an item is a member of the set and
|
||||
// for adding a new item to the set.
|
||||
//
|
||||
// @param item The item to check or add to the Set instance.
|
||||
// @param shouldAdd If true, the item will be added to the set if it doesn't
|
||||
// already exist.
|
||||
// @param set The set instance to check or add to.
|
||||
// @return {boolean} true if the item already existed, otherwise false.
|
||||
//
|
||||
|
||||
|
||||
return _Set;
|
||||
}();
|
||||
|
||||
function hasOrAdd(item, shouldAdd, set) {
|
||||
var type = typeof item;
|
||||
var prevSize, newSize;
|
||||
|
||||
switch (type) {
|
||||
case 'string':
|
||||
case 'number':
|
||||
// distinguish between +0 and -0
|
||||
if (item === 0 && 1 / item === -Infinity) {
|
||||
if (set._items['-0']) {
|
||||
return true;
|
||||
} else {
|
||||
if (shouldAdd) {
|
||||
set._items['-0'] = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
} // these types can all utilise the native Set
|
||||
|
||||
|
||||
if (set._nativeSet !== null) {
|
||||
if (shouldAdd) {
|
||||
prevSize = set._nativeSet.size;
|
||||
|
||||
set._nativeSet.add(item);
|
||||
|
||||
newSize = set._nativeSet.size;
|
||||
return newSize === prevSize;
|
||||
} else {
|
||||
return set._nativeSet.has(item);
|
||||
}
|
||||
} else {
|
||||
if (!(type in set._items)) {
|
||||
if (shouldAdd) {
|
||||
set._items[type] = {};
|
||||
set._items[type][item] = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} else if (item in set._items[type]) {
|
||||
return true;
|
||||
} else {
|
||||
if (shouldAdd) {
|
||||
set._items[type][item] = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
case 'boolean':
|
||||
// set._items['boolean'] holds a two element array
|
||||
// representing [ falseExists, trueExists ]
|
||||
if (type in set._items) {
|
||||
var bIdx = item ? 1 : 0;
|
||||
|
||||
if (set._items[type][bIdx]) {
|
||||
return true;
|
||||
} else {
|
||||
if (shouldAdd) {
|
||||
set._items[type][bIdx] = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (shouldAdd) {
|
||||
set._items[type] = item ? [false, true] : [true, false];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
case 'function':
|
||||
// compare functions for reference equality
|
||||
if (set._nativeSet !== null) {
|
||||
if (shouldAdd) {
|
||||
prevSize = set._nativeSet.size;
|
||||
|
||||
set._nativeSet.add(item);
|
||||
|
||||
newSize = set._nativeSet.size;
|
||||
return newSize === prevSize;
|
||||
} else {
|
||||
return set._nativeSet.has(item);
|
||||
}
|
||||
} else {
|
||||
if (!(type in set._items)) {
|
||||
if (shouldAdd) {
|
||||
set._items[type] = [item];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!_includes(item, set._items[type])) {
|
||||
if (shouldAdd) {
|
||||
set._items[type].push(item);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
case 'undefined':
|
||||
if (set._items[type]) {
|
||||
return true;
|
||||
} else {
|
||||
if (shouldAdd) {
|
||||
set._items[type] = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
case 'object':
|
||||
if (item === null) {
|
||||
if (!set._items['null']) {
|
||||
if (shouldAdd) {
|
||||
set._items['null'] = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* falls through */
|
||||
|
||||
default:
|
||||
// reduce the search size of heterogeneous sets by creating buckets
|
||||
// for each type.
|
||||
type = Object.prototype.toString.call(item);
|
||||
|
||||
if (!(type in set._items)) {
|
||||
if (shouldAdd) {
|
||||
set._items[type] = [item];
|
||||
}
|
||||
|
||||
return false;
|
||||
} // scan through all previously applied items
|
||||
|
||||
|
||||
if (!_includes(item, set._items[type])) {
|
||||
if (shouldAdd) {
|
||||
set._items[type].push(item);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} // A simple Set type that honours R.equals semantics
|
||||
|
||||
|
||||
export default _Set;
|
12
node_modules/ramda/es/internal/_aperture.js
generated
vendored
Normal file
12
node_modules/ramda/es/internal/_aperture.js
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
export default function _aperture(n, list) {
|
||||
var idx = 0;
|
||||
var limit = list.length - (n - 1);
|
||||
var acc = new Array(limit >= 0 ? limit : 0);
|
||||
|
||||
while (idx < limit) {
|
||||
acc[idx] = Array.prototype.slice.call(list, idx, idx + n);
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
return acc;
|
||||
}
|
62
node_modules/ramda/es/internal/_arity.js
generated
vendored
Normal file
62
node_modules/ramda/es/internal/_arity.js
generated
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
export default function _arity(n, fn) {
|
||||
/* eslint-disable no-unused-vars */
|
||||
switch (n) {
|
||||
case 0:
|
||||
return function () {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 1:
|
||||
return function (a0) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 2:
|
||||
return function (a0, a1) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 3:
|
||||
return function (a0, a1, a2) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 4:
|
||||
return function (a0, a1, a2, a3) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 5:
|
||||
return function (a0, a1, a2, a3, a4) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 6:
|
||||
return function (a0, a1, a2, a3, a4, a5) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 7:
|
||||
return function (a0, a1, a2, a3, a4, a5, a6) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 8:
|
||||
return function (a0, a1, a2, a3, a4, a5, a6, a7) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 9:
|
||||
return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 10:
|
||||
return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
|
||||
return fn.apply(this, arguments);
|
||||
};
|
||||
|
||||
default:
|
||||
throw new Error('First argument to _arity must be a non-negative integer no greater than ten');
|
||||
}
|
||||
}
|
10
node_modules/ramda/es/internal/_arrayFromIterator.js
generated
vendored
Normal file
10
node_modules/ramda/es/internal/_arrayFromIterator.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
export default function _arrayFromIterator(iter) {
|
||||
var list = [];
|
||||
var next;
|
||||
|
||||
while (!(next = iter.next()).done) {
|
||||
list.push(next.value);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
7
node_modules/ramda/es/internal/_assertPromise.js
generated
vendored
Normal file
7
node_modules/ramda/es/internal/_assertPromise.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
import _isFunction from "./_isFunction.js";
|
||||
import _toString from "./_toString.js";
|
||||
export default function _assertPromise(name, p) {
|
||||
if (p == null || !_isFunction(p.then)) {
|
||||
throw new TypeError('`' + name + '` expected a Promise, received ' + _toString(p, []));
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue