ramda-extension
Version:
Helpful functions built on top of the mighty Ramda
18 lines (17 loc) • 404 B
JavaScript
import { of, identity, useWith, xprod } from 'ramda';
/**
* Creates pairs from value and list of values.
* Value is always prepended to the pair.
*
* @func
* @category List
* @see xPairsRight
*
* @example
*
* R_.xPairs(1, [2, 3]) // [[1, 2], [1, 3]]
*
* @sig a -> [b] -> [[a, b]]
*/
var xPairs = /*#__PURE__*/useWith(xprod, [/*#__PURE__*/of(Array), identity]);
export default xPairs;