We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56de89c commit c76f755Copy full SHA for c76f755
src/react/JSONTree/obj-type.js
@@ -1,7 +1,6 @@
1
export default function(obj) {
2
- const type = Object.prototype.toString.call(obj).slice(8, -1);
3
- if (type === 'Object' && typeof obj[Symbol.iterator] === 'function') {
+ if (obj !== null && typeof obj === 'object' && typeof obj[Symbol.iterator] === 'function') {
4
return 'Iterable';
5
}
6
- return type;
+ return Object.prototype.toString.call(obj).slice(8, -1);
7
0 commit comments