Sha256: 540cc88da53fd6db2c8faeeb5a37ffd5ee3dbd291a4d9a6233d779ff03f162dc

Contents?: true

Size: 1.02 KB

Versions: 273

Compression:

Stored size: 1.02 KB

Contents

var assignValue = require('./_assignValue'),
    baseAssignValue = require('./_baseAssignValue');

/**
 * Copies properties of `source` to `object`.
 *
 * @private
 * @param {Object} source The object to copy properties from.
 * @param {Array} props The property identifiers to copy.
 * @param {Object} [object={}] The object to copy properties to.
 * @param {Function} [customizer] The function to customize copied values.
 * @returns {Object} Returns `object`.
 */
function copyObject(source, props, object, customizer) {
  var isNew = !object;
  object || (object = {});

  var index = -1,
      length = props.length;

  while (++index < length) {
    var key = props[index];

    var newValue = customizer
      ? customizer(object[key], source[key], key, object, source)
      : undefined;

    if (newValue === undefined) {
      newValue = source[key];
    }
    if (isNew) {
      baseAssignValue(object, key, newValue);
    } else {
      assignValue(object, key, newValue);
    }
  }
  return object;
}

module.exports = copyObject;

Version data entries

273 entries across 271 versions & 29 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/lodash/_copyObject.js
immosquare-cleaner-0.1.59 node_modules/lodash/_copyObject.js
immosquare-cleaner-0.1.58 node_modules/lodash/_copyObject.js
immosquare-cleaner-0.1.57 node_modules/lodash/_copyObject.js
immosquare-cleaner-0.1.56 node_modules/lodash/_copyObject.js
immosquare-cleaner-0.1.55 node_modules/lodash/_copyObject.js
immosquare-cleaner-0.1.54 node_modules/lodash/_copyObject.js
immosquare-cleaner-0.1.53 node_modules/lodash/_copyObject.js
immosquare-cleaner-0.1.52 node_modules/lodash/_copyObject.js
trusty-cms-6.3.1 node_modules/lodash/_copyObject.js
immosquare-cleaner-0.1.51 node_modules/lodash/_copyObject.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/_copyObject.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/_copyObject.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/_copyObject.js
immosquare-cleaner-0.1.50 node_modules/lodash/_copyObject.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/_copyObject.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/_copyObject.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/_copyObject.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/_copyObject.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/_copyObject.js