identity.js 593 B

123456789101112131415161718192021222324252627
  1. import _curry1 from "./internal/_curry1.js";
  2. import _identity from "./internal/_identity.js";
  3. /**
  4. * A function that does nothing but return the parameter supplied to it. Good
  5. * as a default or placeholder function.
  6. *
  7. * @func
  8. * @memberOf R
  9. * @since v0.1.0
  10. * @category Function
  11. * @sig a -> a
  12. * @param {*} x The value to return.
  13. * @return {*} The input value, `x`.
  14. * @example
  15. *
  16. * R.identity(1); //=> 1
  17. *
  18. * const obj = {};
  19. * R.identity(obj) === obj; //=> true
  20. * @symb R.identity(a) = a
  21. */
  22. var identity =
  23. /*#__PURE__*/
  24. _curry1(_identity);
  25. export default identity;