UNPKG

ramda-extension

Version:

Helpful functions built on top of the mighty Ramda

31 lines (28 loc) 708 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ramda = require("ramda"); /** * Creates list of length `n`. Every item in list equals to `input` parameter. * * @param {Number} n How many times replicate `input` * @param {a} input Value for replication * * @return List List of length `n`. Every item in list equals to `input` parameter * * @func * @category List * * @example * * R_.replicate(1, 6) // [6] * R_.replicate(2, 6) // [6, 6] * R_.replicate(3, 6) // [6, 6, 6] * * @sig Number -> a -> [a] */ var replicate = (0, _ramda.flip)(_ramda.repeat); var _default = replicate; exports.default = _default;