LodashWrapper.js 658 B

123456789101112131415161718192021
  1. var baseCreate = require('./baseCreate'),
  2. baseLodash = require('./baseLodash');
  3. /**
  4. * The base constructor for creating `lodash` wrapper objects.
  5. *
  6. * @private
  7. * @param {*} value The value to wrap.
  8. * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
  9. * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
  10. */
  11. function LodashWrapper(value, chainAll, actions) {
  12. this.__wrapped__ = value;
  13. this.__actions__ = actions || [];
  14. this.__chain__ = !!chainAll;
  15. }
  16. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  17. LodashWrapper.prototype.constructor = LodashWrapper;
  18. module.exports = LodashWrapper;