ramda-extension
Version:
Helpful functions built on top of the mighty Ramda
35 lines (30 loc) • 965 B
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _ramda = require("ramda");
var _composeC = _interopRequireDefault(require("./composeC"));
/**
* Returns a new list containing the unique contents of the given list, starting by the given element.
*
* @func
* @category List
*
* @param {any} el The element to add to the tart of the new list.
* @param Array list The list of elements to add a new item to.
*
* @return Array A new list with the given element at the front following by the elements of the old list.
*
*
* @example
*
* R_.uniqPrepend("b", ["a", "b"]) // ["b", "a"]
* R_.uniqPrepend("d", ["a", "b"]) // ["d","a", "b"]
*
* @sig a -> [a] -> [a]
*/
var uniqPrepend = (0, _composeC.default)(_ramda.uniq, _ramda.prepend);
var _default = uniqPrepend;
exports.default = _default;