Sha256: 86658dd4d24a55b19ed938416c179d57a729bac601133c237ee9f900dd21027d

Contents?: true

Size: 899 Bytes

Versions: 273

Compression:

Stored size: 899 Bytes

Contents

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

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Assigns `value` to `key` of `object` if the existing value is not equivalent
 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
 * for equality comparisons.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {string} key The key of the property to assign.
 * @param {*} value The value to assign.
 */
function assignValue(object, key, value) {
  var objValue = object[key];
  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
      (value === undefined && !(key in object))) {
    baseAssignValue(object, key, value);
  }
}

module.exports = assignValue;

Version data entries

273 entries across 271 versions & 29 rubygems

Version Path
govuk_publishing_components-17.6.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-17.5.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-17.4.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-17.3.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-17.2.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-17.1.1 node_modules/lodash/_assignValue.js
govuk_publishing_components-17.1.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-17.0.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.29.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.28.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.27.1 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.27.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.26.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.25.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.24.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.23.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.22.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.21.0 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.20.1 node_modules/lodash/_assignValue.js
govuk_publishing_components-16.20.0 node_modules/lodash/_assignValue.js