mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Bump to v4.12.0.
This commit is contained in:
11
toPairs.js
11
toPairs.js
@@ -1,9 +1,10 @@
|
||||
import baseToPairs from './_baseToPairs';
|
||||
import createToPairs from './_createToPairs';
|
||||
import keys from './keys';
|
||||
|
||||
/**
|
||||
* Creates an array of own enumerable string keyed-value pairs for `object`
|
||||
* which can be consumed by `_.fromPairs`.
|
||||
* which can be consumed by `_.fromPairs`. If `object` is a map or set, its
|
||||
* entries are returned.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -11,7 +12,7 @@ import keys from './keys';
|
||||
* @alias entries
|
||||
* @category Object
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the new array of key-value pairs.
|
||||
* @returns {Array} Returns the key-value pairs.
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
@@ -24,8 +25,6 @@ import keys from './keys';
|
||||
* _.toPairs(new Foo);
|
||||
* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
|
||||
*/
|
||||
function toPairs(object) {
|
||||
return baseToPairs(object, keys(object));
|
||||
}
|
||||
var toPairs = createToPairs(keys);
|
||||
|
||||
export default toPairs;
|
||||
|
||||
Reference in New Issue
Block a user