Fix object coercion.

This commit is contained in:
John-David Dalton
2017-04-16 15:30:42 -05:00
parent e2941dda3b
commit aa5e1b2fe0
7 changed files with 20 additions and 10 deletions

View File

@@ -21,8 +21,10 @@
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*/
function mapValue(object, iteratee) {
object = Object(object)
const result = {}
Object.keys(Object(object)).forEach((key) => {
Object.keys(object).forEach((key) => {
result[key] = iteratee(object[key], key, object)
})
return result