ramda-extension
Version:
Helpful functions built on top of the mighty Ramda
23 lines (22 loc) • 596 B
JavaScript
import { curry, compose, isEmpty, difference } from '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 = /*#__PURE__*/curry( /*#__PURE__*/compose(isEmpty, difference));
export default containsAll;