X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=node_modules%2Funcss%2Fnode_modules%2Fform-data%2Fnode_modules%2Flodash%2Fproperty.js;fp=node_modules%2Funcss%2Fnode_modules%2Fform-data%2Fnode_modules%2Flodash%2Fproperty.js;h=ca8202ff454baaf11708ae3869b1f19f892b8d28;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/node_modules/uncss/node_modules/form-data/node_modules/lodash/property.js b/node_modules/uncss/node_modules/form-data/node_modules/lodash/property.js new file mode 100644 index 000000000..ca8202ff4 --- /dev/null +++ b/node_modules/uncss/node_modules/form-data/node_modules/lodash/property.js @@ -0,0 +1,32 @@ +var baseProperty = require('./_baseProperty'), + basePropertyDeep = require('./_basePropertyDeep'), + isKey = require('./_isKey'), + toKey = require('./_toKey'); + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = property;