update
This commit is contained in:
parent
d9becc67b6
commit
9308795b8b
964 changed files with 104265 additions and 16 deletions
43
node_modules/ramda/src/repeat.js
generated
vendored
Normal file
43
node_modules/ramda/src/repeat.js
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
var _curry2 =
|
||||
/*#__PURE__*/
|
||||
require("./internal/_curry2");
|
||||
|
||||
var always =
|
||||
/*#__PURE__*/
|
||||
require("./always");
|
||||
|
||||
var times =
|
||||
/*#__PURE__*/
|
||||
require("./times");
|
||||
/**
|
||||
* Returns a fixed list of size `n` containing a specified identical value.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.1
|
||||
* @category List
|
||||
* @sig a -> n -> [a]
|
||||
* @param {*} value The value to repeat.
|
||||
* @param {Number} n The desired size of the output list.
|
||||
* @return {Array} A new array containing `n` `value`s.
|
||||
* @see R.times
|
||||
* @example
|
||||
*
|
||||
* R.repeat('hi', 5); //=> ['hi', 'hi', 'hi', 'hi', 'hi']
|
||||
*
|
||||
* const obj = {};
|
||||
* const repeatedObjs = R.repeat(obj, 5); //=> [{}, {}, {}, {}, {}]
|
||||
* repeatedObjs[0] === repeatedObjs[1]; //=> true
|
||||
* @symb R.repeat(a, 0) = []
|
||||
* @symb R.repeat(a, 1) = [a]
|
||||
* @symb R.repeat(a, 2) = [a, a]
|
||||
*/
|
||||
|
||||
|
||||
var repeat =
|
||||
/*#__PURE__*/
|
||||
_curry2(function repeat(value, n) {
|
||||
return times(always(value), n);
|
||||
});
|
||||
|
||||
module.exports = repeat;
|
||||
Loading…
Add table
Add a link
Reference in a new issue