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

@@ -24,9 +24,8 @@
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forOwn(object, iteratee) {
if (object != null) {
Object.keys(Object(object)).forEach((key) => iteratee(object[key], key, object))
}
object = Object(object)
Object.keys(object).forEach((key) => iteratee(object[key], key, object))
}
export default forOwn