Skip to content

Commit

Permalink
use once Object.prototype.toString.call
Browse files Browse the repository at this point in the history
  • Loading branch information
omarsy committed Aug 21, 2020
1 parent e8e9fa2 commit 4356927
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/react-devtools-shared/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,13 @@ export function getDataType(data: Object): DataType {
return 'iterator';
} else if (data.constructor && data.constructor.name === 'RegExp') {
return 'regexp';
} else if (Object.prototype.toString.call(data) === '[object Date]') {
return 'date';
} else if (
Object.prototype.toString.call(data) === '[object HTMLAllCollection]'
) {
return 'html_all_collection';
} else {
const toStringValue = Object.prototype.toString.call(data);
if (toStringValue === '[object Date]') {
return 'date';
} else if (toStringValue === '[object HTMLAllCollection]') {
return 'html_all_collection';
}
}
return 'object';
case 'string':
Expand Down

0 comments on commit 4356927

Please sign in to comment.