PHP 8.2.30
Preview: method.js Size: 907 B
//opt/alt/alt-nodejs9/root/lib/node_modules/npm/node_modules/cli-table2/node_modules/lodash/utility/method.js

var invokePath = require('../internal/invokePath'),
    restParam = require('../function/restParam');

/**
 * Creates a function that invokes the method at `path` on a given object.
 * Any additional arguments are provided to the invoked method.
 *
 * @static
 * @memberOf _
 * @category Utility
 * @param {Array|string} path The path of the method to invoke.
 * @param {...*} [args] The arguments to invoke the method with.
 * @returns {Function} Returns the new function.
 * @example
 *
 * var objects = [
 *   { 'a': { 'b': { 'c': _.constant(2) } } },
 *   { 'a': { 'b': { 'c': _.constant(1) } } }
 * ];
 *
 * _.map(objects, _.method('a.b.c'));
 * // => [2, 1]
 *
 * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
 * // => [1, 2]
 */
var method = restParam(function(path, args) {
  return function(object) {
    return invokePath(object, path, args);
  };
});

module.exports = method;

Directory Contents

Dirs: 0 × Files: 16

Name Size Perms Modified Actions
839 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download
1.70 KB lrw-r--r-- 2021-09-28 11:28:36
Edit Download
444 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download
355 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download
40 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download
1.10 KB lrw-r--r-- 2021-09-28 11:28:36
Edit Download
957 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download
907 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download
912 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download
2.37 KB lrw-r--r-- 2021-09-28 11:28:36
Edit Download
328 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download
799 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download
764 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download
1.66 KB lrw-r--r-- 2021-09-28 11:28:36
Edit Download
1.68 KB lrw-r--r-- 2021-09-28 11:28:36
Edit Download
570 B lrw-r--r-- 2021-09-28 11:28:36
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).