PHP 8.2.30
Preview: pick.js Size: 1.47 KB
//opt/alt/alt-nodejs9/root/lib/node_modules/npm/node_modules/cli-table2/node_modules/lodash/object/pick.js

var baseFlatten = require('../internal/baseFlatten'),
    bindCallback = require('../internal/bindCallback'),
    pickByArray = require('../internal/pickByArray'),
    pickByCallback = require('../internal/pickByCallback'),
    restParam = require('../function/restParam');

/**
 * Creates an object composed of the picked `object` properties. Property
 * names may be specified as individual arguments or as arrays of property
 * names. If `predicate` is provided it's invoked for each property of `object`
 * picking the properties `predicate` returns truthy for. The predicate is
 * bound to `thisArg` and invoked with three arguments: (value, key, object).
 *
 * @static
 * @memberOf _
 * @category Object
 * @param {Object} object The source object.
 * @param {Function|...(string|string[])} [predicate] The function invoked per
 *  iteration or property names to pick, specified as individual property
 *  names or arrays of property names.
 * @param {*} [thisArg] The `this` binding of `predicate`.
 * @returns {Object} Returns the new object.
 * @example
 *
 * var object = { 'user': 'fred', 'age': 40 };
 *
 * _.pick(object, 'user');
 * // => { 'user': 'fred' }
 *
 * _.pick(object, _.isString);
 * // => { 'user': 'fred' }
 */
var pick = restParam(function(object, props) {
  if (object == null) {
    return {};
  }
  return typeof props[0] == 'function'
    ? pickByCallback(object, bindCallback(props[0], props[1], 3))
    : pickByArray(object, baseFlatten(props));
});

module.exports = pick;

Directory Contents

Dirs: 0 × Files: 29

Name Size Perms Modified Actions
1.58 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.24 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
835 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
745 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
38 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.78 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.79 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
980 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
840 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
975 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
844 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
575 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
951 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.56 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.54 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.27 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.62 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
781 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.57 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.67 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
41 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.56 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
800 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.47 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.54 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
1.36 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
2.10 KB lrw-r--r-- 2021-09-28 11:28:33
Edit Download
691 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download
681 B lrw-r--r-- 2021-09-28 11:28:33
Edit Download

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