MCPcopy Create free account
hub / github.com/RubyLouvre/anu / createAssigner

Function createAssigner

test/babel.js:10198–10220  ·  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

10196 * @returns {Function} Returns the new assigner function.
10197 */
10198 function createAssigner(assigner) {
10199 return baseRest(function (object, sources) {
10200 var index = -1,
10201 length = sources.length,
10202 customizer = length > 1 ? sources[length - 1] : undefined,
10203 guard = length > 2 ? sources[2] : undefined;
10204
10205 customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined;
10206
10207 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
10208 customizer = length < 3 ? undefined : customizer;
10209 length = 1;
10210 }
10211 object = Object(object);
10212 while (++index < length) {
10213 var source = sources[index];
10214 if (source) {
10215 assigner(object, source, index, customizer);
10216 }
10217 }
10218 return object;
10219 });
10220 }
10221
10222 module.exports = createAssigner;
10223

Callers 1

babel.jsFile · 0.85

Calls 2

baseRestFunction · 0.85
isIterateeCallFunction · 0.85

Tested by

no test coverage detected