LazyWrapper.js 701 B

1234567891011121314151617181920212223242526
  1. var baseCreate = require('./baseCreate'),
  2. baseLodash = require('./baseLodash');
  3. /** Used as references for `-Infinity` and `Infinity`. */
  4. var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
  5. /**
  6. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  7. *
  8. * @private
  9. * @param {*} value The value to wrap.
  10. */
  11. function LazyWrapper(value) {
  12. this.__wrapped__ = value;
  13. this.__actions__ = [];
  14. this.__dir__ = 1;
  15. this.__filtered__ = false;
  16. this.__iteratees__ = [];
  17. this.__takeCount__ = POSITIVE_INFINITY;
  18. this.__views__ = [];
  19. }
  20. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  21. LazyWrapper.prototype.constructor = LazyWrapper;
  22. module.exports = LazyWrapper;