Sha256: 244a92bbbc71a52c87e34638189f95fd69f671fb39a1a32729511f054548ffa4

Contents?: true

Size: 1.02 KB

Versions: 274

Compression:

Stored size: 1.02 KB

Contents

var baseRest = require('./_baseRest'),
    isIterateeCall = require('./_isIterateeCall');

/**
 * Creates a function like `_.assign`.
 *
 * @private
 * @param {Function} assigner The function to assign values.
 * @returns {Function} Returns the new assigner function.
 */
function createAssigner(assigner) {
  return baseRest(function(object, sources) {
    var index = -1,
        length = sources.length,
        customizer = length > 1 ? sources[length - 1] : undefined,
        guard = length > 2 ? sources[2] : undefined;

    customizer = (assigner.length > 3 && typeof customizer == 'function')
      ? (length--, customizer)
      : undefined;

    if (guard && isIterateeCall(sources[0], sources[1], guard)) {
      customizer = length < 3 ? undefined : customizer;
      length = 1;
    }
    object = Object(object);
    while (++index < length) {
      var source = sources[index];
      if (source) {
        assigner(object, source, index, customizer);
      }
    }
    return object;
  });
}

module.exports = createAssigner;

Version data entries

274 entries across 272 versions & 30 rubygems

Version Path
clapton-0.0.19 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.18 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.17 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.16 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.15 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
immosquare-cleaner-0.1.49 node_modules/lodash/_createAssigner.js
clapton-0.0.14 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
immosquare-cleaner-0.1.48 node_modules/lodash/_createAssigner.js
clapton-0.0.13 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.12 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.11 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.10 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.9 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.8 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.7 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.6 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.5 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.4 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.3 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js
clapton-0.0.2 lib/clapton/javascripts/node_modules/lodash/_createAssigner.js