wrapperChain.js 706 B

1234567891011121314151617181920212223242526272829303132333435
  1. var chain = require('./chain');
  2. /**
  3. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  4. *
  5. * @name chain
  6. * @memberOf _
  7. * @since 0.1.0
  8. * @category Seq
  9. * @returns {Object} Returns the new `lodash` wrapper instance.
  10. * @example
  11. *
  12. * var users = [
  13. * { 'user': 'barney', 'age': 36 },
  14. * { 'user': 'fred', 'age': 40 }
  15. * ];
  16. *
  17. * // A sequence without explicit chaining.
  18. * _(users).head();
  19. * // => { 'user': 'barney', 'age': 36 }
  20. *
  21. * // A sequence with explicit chaining.
  22. * _(users)
  23. * .chain()
  24. * .head()
  25. * .pick('user')
  26. * .value();
  27. * // => { 'user': 'barney' }
  28. */
  29. function wrapperChain() {
  30. return chain(this);
  31. }
  32. module.exports = wrapperChain;