X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Flodash%2Fset.js;fp=node_modules%2Funcss%2Fnode_modules%2Flodash%2Fset.js;h=6716153001aaed6565217e1279eedb4f30d21c0d;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/lodash/set.js b/node_modules/uncss/node_modules/lodash/set.js new file mode 100644 index 000000000..671615300 --- /dev/null +++ b/node_modules/uncss/node_modules/lodash/set.js @@ -0,0 +1,32 @@ +var baseSet = require('./internal/baseSet'); + +/** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, 'x[0].y.z', 5); + * console.log(object.x[0].y.z); + * // => 5 + */ +function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); +} + +module.exports = set;