mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Fix object coercion.
This commit is contained in:
@@ -18,8 +18,10 @@
|
||||
* // => { 'a1': 1, 'b2': 2 }
|
||||
*/
|
||||
function mapKey(object, iteratee) {
|
||||
object = Object(object)
|
||||
const result = {}
|
||||
Object.keys(Object(object)).forEach((key) => {
|
||||
|
||||
Object.keys(object).forEach((key) => {
|
||||
const value = object[key]
|
||||
result[iteratee(value, key, object)] = value
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user