mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Bump to v4.12.0.
This commit is contained in:
13
toPairsIn.js
13
toPairsIn.js
@@ -1,9 +1,10 @@
|
||||
import baseToPairs from './_baseToPairs';
|
||||
import createToPairs from './_createToPairs';
|
||||
import keysIn from './keysIn';
|
||||
|
||||
/**
|
||||
* Creates an array of own and inherited enumerable string keyed-value pairs
|
||||
* for `object` which can be consumed by `_.fromPairs`.
|
||||
* for `object` which can be consumed by `_.fromPairs`. If `object` is a map
|
||||
* or set, its entries are returned.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -11,7 +12,7 @@ import keysIn from './keysIn';
|
||||
* @alias entriesIn
|
||||
* @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() {
|
||||
@@ -22,10 +23,8 @@ import keysIn from './keysIn';
|
||||
* Foo.prototype.c = 3;
|
||||
*
|
||||
* _.toPairsIn(new Foo);
|
||||
* // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)
|
||||
* // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
|
||||
*/
|
||||
function toPairsIn(object) {
|
||||
return baseToPairs(object, keysIn(object));
|
||||
}
|
||||
var toPairsIn = createToPairs(keysIn);
|
||||
|
||||
export default toPairsIn;
|
||||
|
||||
Reference in New Issue
Block a user