ramda-extension
Version:
Helpful functions built on top of the mighty Ramda
35 lines (30 loc) • 939 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, followed by the given element.
*
* @func
* @category List
*
* @param {any} 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.
*
* @return Array A new list containing the elements of the old list followed by `el`.
*
*
* @example
*
* R_.uniqAppend("a", ["a", "b"]) // ["a", "b"]
* R_.uniqAppend("d", ["a", "b"]) // ["a", "b", "d"]
*
* @sig a -> [a] -> [a]
*/
var uniqAppend = (0, _composeC.default)(_ramda.uniq, _ramda.append);
var _default = uniqAppend;
exports.default = _default;