mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-22 01:26:48 +03:00
safer type checking for iterable structures
This commit is contained in:
parent
56de89c440
commit
c76f755863
|
@ -1,7 +1,6 @@
|
|||
export default function(obj) {
|
||||
const type = Object.prototype.toString.call(obj).slice(8, -1);
|
||||
if (type === 'Object' && typeof obj[Symbol.iterator] === 'function') {
|
||||
if (obj !== null && typeof obj === 'object' && typeof obj[Symbol.iterator] === 'function') {
|
||||
return 'Iterable';
|
||||
}
|
||||
return type;
|
||||
return Object.prototype.toString.call(obj).slice(8, -1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user