CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
methodOf.js34 linesDownload Raw Back to lodash
1var baseInvoke = require('./_baseInvoke'),2    baseRest = require('./_baseRest');3 4/**5 * The opposite of `_.method`; this method creates a function that invokes6 * the method at a given path of `object`. Any additional arguments are7 * provided to the invoked method.8 *9 * @static10 * @memberOf _11 * @since 3.7.012 * @category Util13 * @param {Object} object The object to query.14 * @param {...*} [args] The arguments to invoke the method with.15 * @returns {Function} Returns the new invoker function.16 * @example17 *18 * var array = _.times(3, _.constant),19 *     object = { 'a': array, 'b': array, 'c': array };20 *21 * _.map(['a[2]', 'c[0]'], _.methodOf(object));22 * // => [2, 0]23 *24 * _.map([['a', '2'], ['c', '0']], _.methodOf(object));25 * // => [2, 0]26 */27var methodOf = baseRest(function(object, args) {28  return function(path) {29    return baseInvoke(object, path, args);30  };31});32 33module.exports = methodOf;34 
basant307/AI_Governance_Project · CoolFace