X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Flodash%2Finternal%2FassignInDefaults.js;fp=node_modules%2Funcss%2Fnode_modules%2Flodash%2Finternal%2FassignInDefaults.js;h=dd351c0e8b796c4a60d2377bc60ebac43c3020be;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/lodash/internal/assignInDefaults.js b/node_modules/uncss/node_modules/lodash/internal/assignInDefaults.js new file mode 100644 index 000000000..dd351c0e8 --- /dev/null +++ b/node_modules/uncss/node_modules/lodash/internal/assignInDefaults.js @@ -0,0 +1,27 @@ +var eq = require('../eq'); + +/** Used for built-in method references. */ +var objectProto = global.Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used by `_.defaults` to customize its `_.assignIn` use. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ +function assignInDefaults(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; +} + +module.exports = assignInDefaults;