UNPKG

ramda-extension

Version:

Helpful functions built on top of the mighty Ramda

30 lines (27 loc) 722 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ramda = require("ramda"); /** * Returns `true` if any of the items from first array are in the second array. * * @func * @category List * * @param {Array} List * @param {Array} List * @return {Boolean} If any of the items from first array are in the second array. * * @example * * R_.containsAny(['a', 'e'], ['a', 'b', 'c']) // true * R_.containsAny(['e', 'f'], ['a', 'b', 'c']) // false * * @sig [a] -> [a] -> Boolean * */ var containsAny = (0, _ramda.curry)((0, _ramda.compose)(_ramda.not, _ramda.isEmpty, _ramda.intersection)); var _default = containsAny; exports.default = _default;