* Creates a clone of the chained sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ * @category Chain * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2]; * var wrapper = _(array).map
(value)
| 7515 | * // => [1, 4] |
| 7516 | */ |
| 7517 | function wrapperPlant(value) { |
| 7518 | var result, |
| 7519 | parent = this; |
| 7520 | |
| 7521 | while (parent instanceof baseLodash) { |
| 7522 | var clone = wrapperClone(parent); |
| 7523 | if (result) { |
| 7524 | previous.__wrapped__ = clone; |
| 7525 | } else { |
| 7526 | result = clone; |
| 7527 | } |
| 7528 | var previous = clone; |
| 7529 | parent = parent.__wrapped__; |
| 7530 | } |
| 7531 | previous.__wrapped__ = value; |
| 7532 | return result; |
| 7533 | } |
| 7534 | |
| 7535 | /** |
| 7536 | * Reverses the wrapped array so the first element becomes the last, the |
nothing calls this directly
no test coverage detected