X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Flodash%2FmethodOf.js;fp=node_modules%2Funcss%2Fnode_modules%2Flodash%2FmethodOf.js;h=03202b16650ca257e7faf264136564b7d23a60b3;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/lodash/methodOf.js b/node_modules/uncss/node_modules/lodash/methodOf.js new file mode 100644 index 000000000..03202b166 --- /dev/null +++ b/node_modules/uncss/node_modules/lodash/methodOf.js @@ -0,0 +1,32 @@ +var baseInvoke = require('./internal/baseInvoke'), + rest = require('./rest'); + +/** + * The opposite of `_.method`; this method creates a function that invokes + * the method at a given path of `object`. Any additional arguments are + * provided to the invoked method. + * + * @static + * @memberOf _ + * @category Util + * @param {Object} object The object to query. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {Function} Returns the new function. + * @example + * + * var array = _.times(3, _.constant), + * object = { 'a': array, 'b': array, 'c': array }; + * + * _.map(['a[2]', 'c[0]'], _.methodOf(object)); + * // => [2, 0] + * + * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); + * // => [2, 0] + */ +var methodOf = rest(function(object, args) { + return function(path) { + return baseInvoke(object, path, args); + }; +}); + +module.exports = methodOf;