Files
lodash/_baseToPairs.js
John-David Dalton 466c67a8b6 Bump to v4.1.0.
2016-01-29 01:20:57 -08:00

19 lines
545 B
JavaScript

import arrayMap from './_arrayMap';
/**
* The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
* of key-value pairs for `object` corresponding to the property names of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the new array of key-value pairs.
*/
function baseToPairs(object, props) {
return arrayMap(props, function(key) {
return [key, object[key]];
});
}
export default baseToPairs;