The Wayback Machine - https://web.archive.org/web/20170626182200/https://github.com/lodash/lodash/blob/master/pick.js
Skip to content
Permalink
6cb3460 Feb 6, 2017
23 lines (20 sloc) 552 Bytes
import basePick from './.internal/basePick.js'
/**
* Creates an object composed of the picked `object` properties.
*
* @since 0.1.0
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new object.
* @example
*
* const object = { 'a': 1, 'b': '2', 'c': 3 }
*
* pick(object, ['a', 'c'])
* // => { 'a': 1, 'c': 3 }
*/
function pick(object, ...paths) {
return object == null ? {} : basePick(object, paths)
}
export default pick
You can't perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.