Fixin loop args order regression from 3c2795b in invert.

This commit is contained in:
Michał Lipiński
2017-07-14 13:10:04 +02:00
parent 01148a1df8
commit 536f09b68c

View File

@@ -18,7 +18,8 @@ const toString = Object.prototype.toString
*/
function invert(object) {
const result = {}
Object.keys(object).forEach((value, key) => {
Object.keys(object).forEach((key) => {
let value = object[key]
if (value != null && typeof value.toString != 'function') {
value = toString.call(value)
}