mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 17:27:22 +08:00
DISABLE_THIRD_PARTY_CHECK=new npm module causes package-lock change We can get rid of a custom script and use ESLint for these rules. Additionally this means editors will highlight the issue in the editor. Change-Id: I552b52e7f07b4e7430b3f685dbc3b5fad36ffff2 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2052167 Reviewed-by: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
31 lines
898 B
JavaScript
31 lines
898 B
JavaScript
import _curry2 from './internal/_curry2.js';
|
|
import always from './always.js';
|
|
import times from './times.js';
|
|
|
|
/**
|
|
* 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);
|
|
});
|
|
export default repeat; |