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
sumomo-0.7.3 data/sumomo/api_modules/node_modules/lodash/_assignValue.js
sumomo-0.7.2 data/sumomo/api_modules/node_modules/lodash/_assignValue.js
sumomo-0.7.1 data/sumomo/api_modules/node_modules/lodash/_assignValue.js
sumomo-0.6.4 data/sumomo/api_modules/node_modules/lodash/_assignValue.js
sumomo-0.6.3 data/sumomo/api_modules/node_modules/lodash/_assignValue.js
sumomo-0.6.2 data/sumomo/api_modules/node_modules/lodash/_assignValue.js
sumomo-0.6.1 data/sumomo/api_modules/node_modules/lodash/_assignValue.js
affiliator-0.2.1 node_modules/lodash/_assignValue.js
sumomo-0.6.0 data/sumomo/api_modules/node_modules/lodash/_assignValue.js
guard-sass-lint-0.1.2 node_modules/lodash/_assignValue.js
guard-sass-lint-0.1.1 node_modules/lodash/_assignValue.js
lanes-0.8.0 node_modules/globule/node_modules/lodash/_assignValue.js
lanes-0.8.0 node_modules/lodash/_assignValue.js