MCPcopy
hub / github.com/lodash/lodash / wrapperPlant

Function wrapperPlant

lodash.js:9072–9090  ·  view source on GitHub ↗

* Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ * @since 3.2.0 * @category Seq * @param {*} value The value to plant. * @returns {Object} Returns the new `lodash` wrapper instance. * @example *

(value)

Source from the content-addressed store, hash-verified

9070 * // => [1, 4]
9071 */
9072 function wrapperPlant(value) {
9073 var result,
9074 parent = this;
9075
9076 while (parent instanceof baseLodash) {
9077 var clone = wrapperClone(parent);
9078 clone.__index__ = 0;
9079 clone.__values__ = undefined;
9080 if (result) {
9081 previous.__wrapped__ = clone;
9082 } else {
9083 result = clone;
9084 }
9085 var previous = clone;
9086 parent = parent.__wrapped__;
9087 }
9088 previous.__wrapped__ = value;
9089 return result;
9090 }
9091
9092 /**
9093 * This method is the wrapper version of `_.reverse`.

Callers

nothing calls this directly

Calls 1

wrapperCloneFunction · 0.85

Tested by

no test coverage detected