MCPcopy Index your code
hub / github.com/deployd/deployd / createAssigner

Function createAssigner

test-app/public/sinon.js:15465–15489  ·  view source on GitHub ↗

* Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function.

(assigner)

Source from the content-addressed store, hash-verified

15463 * @returns {Function} Returns the new assigner function.
15464 */
15465 function createAssigner(assigner) {
15466 return baseRest(function(object, sources) {
15467 var index = -1,
15468 length = sources.length,
15469 customizer = length > 1 ? sources[length - 1] : undefined,
15470 guard = length > 2 ? sources[2] : undefined;
15471
15472 customizer = (assigner.length > 3 && typeof customizer == 'function')
15473 ? (length--, customizer)
15474 : undefined;
15475
15476 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
15477 customizer = length < 3 ? undefined : customizer;
15478 length = 1;
15479 }
15480 object = Object(object);
15481 while (++index < length) {
15482 var source = sources[index];
15483 if (source) {
15484 assigner(object, source, index, customizer);
15485 }
15486 }
15487 return object;
15488 });
15489 }
15490
15491 /**
15492 * Creates a `baseEach` or `baseEachRight` function.

Callers 1

sinon.jsFile · 0.85

Calls 2

baseRestFunction · 0.85
isIterateeCallFunction · 0.85

Tested by

no test coverage detected