From 04f15f6d4de80f09544048c9bc606853309293c2 Mon Sep 17 00:00:00 2001 From: FredyC Date: Sat, 22 Aug 2015 06:13:04 +0200 Subject: [PATCH] arrays shouldn't be treated as an iterable --- src/react/JSONTree/obj-type.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/react/JSONTree/obj-type.js b/src/react/JSONTree/obj-type.js index 40dfd8d1..fb120606 100644 --- a/src/react/JSONTree/obj-type.js +++ b/src/react/JSONTree/obj-type.js @@ -1,5 +1,7 @@ export default function(obj) { - if (obj !== null && typeof obj === 'object' && typeof obj[Symbol.iterator] === 'function') { + if (obj !== null && typeof obj === 'object' && !Array.isArray(obj) && + typeof obj[Symbol.iterator] === 'function' + ) { return 'Iterable'; } return Object.prototype.toString.call(obj).slice(8, -1);