unnest.js 596 B

123456789101112131415161718192021222324
  1. import _identity from "./internal/_identity.js";
  2. import chain from "./chain.js";
  3. /**
  4. * Shorthand for `R.chain(R.identity)`, which removes one level of nesting from
  5. * any [Chain](https://github.com/fantasyland/fantasy-land#chain).
  6. *
  7. * @func
  8. * @memberOf R
  9. * @since v0.3.0
  10. * @category List
  11. * @sig Chain c => c (c a) -> c a
  12. * @param {*} list
  13. * @return {*}
  14. * @see R.flatten, R.chain
  15. * @example
  16. *
  17. * R.unnest([1, [2], [[3]]]); //=> [1, 2, [3]]
  18. * R.unnest([[1, 2], [3, 4], [5, 6]]); //=> [1, 2, 3, 4, 5, 6]
  19. */
  20. var unnest =
  21. /*#__PURE__*/
  22. chain(_identity);
  23. export default unnest;