MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / wrapperPlant

Function wrapperPlant

lib/web/jshint.js:7517–7533  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

wrapperCloneFunction · 0.85

Tested by

no test coverage detected