ramda-extension
Version:
Helpful functions built on top of the mighty Ramda
31 lines (28 loc) • 712 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _ramda = require("ramda");
/**
* Resolves to true if all elements in first list are found within the second list
*
* @func
* @category List
*
*
* @param {Array} List
* @param {Array} List
* @return {Boolean} If all items from first array are in the second array.
*
* @example
*
* R_.containsAll(['a', 'b'], ['a', 'b', 'c']) // true
* R_.containsAll(['a', 'b', 'd'], ['a', 'b', 'c']) // false
*
* @sig [a] -> [a] -> Boolean
*
*/
var containsAll = (0, _ramda.curry)((0, _ramda.compose)(_ramda.isEmpty, _ramda.difference));
var _default = containsAll;
exports.default = _default;