mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
committed by
John-David Dalton
parent
92a6575137
commit
b8dfb7cc14
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* The inverse of `toPairs`is method returns an object composed
|
* The inverse of `entries`is method returns an object composed
|
||||||
* from key-value `pairs`.
|
* from key-value `pairs`.
|
||||||
*
|
*
|
||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
@@ -8,10 +8,10 @@
|
|||||||
* @returns {Object} Returns the new object.
|
* @returns {Object} Returns the new object.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* fromPairs([['a', 1], ['b', 2]])
|
* fromEntries([['a', 1], ['b', 2]])
|
||||||
* // => { 'a': 1, 'b': 2 }
|
* // => { 'a': 1, 'b': 2 }
|
||||||
*/
|
*/
|
||||||
function fromPairs(pairs) {
|
function fromEntries(pairs) {
|
||||||
const result = {}
|
const result = {}
|
||||||
if (pairs == null) {
|
if (pairs == null) {
|
||||||
return result
|
return result
|
||||||
@@ -22,4 +22,4 @@ function fromPairs(pairs) {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
export default fromPairs
|
export default fromEntries
|
||||||
Reference in New Issue
Block a user