mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-25 19:13:56 +03:00
using Number.isSafeInteger for iterable size (+ fixed some comments)
This commit is contained in:
parent
11af53ccfb
commit
fff7e39874
|
@ -50,7 +50,7 @@ export default class JSONIterableNode extends React.Component {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the child nodes for each element in the array. If we have
|
// Returns the child nodes for each entry in iterable. If we have
|
||||||
// generated them previously, we return from cache, otherwise we create
|
// generated them previously, we return from cache, otherwise we create
|
||||||
// them.
|
// them.
|
||||||
getChildNodes() {
|
getChildNodes() {
|
||||||
|
@ -81,13 +81,13 @@ export default class JSONIterableNode extends React.Component {
|
||||||
return this.renderedChildren;
|
return this.renderedChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the "n Items" string for this node, generating and
|
// Returns the "n entries" string for this node, generating and
|
||||||
// caching it if it hasn't been created yet.
|
// caching it if it hasn't been created yet.
|
||||||
getItemString() {
|
getItemString() {
|
||||||
if (!this.itemString) {
|
if (!this.itemString) {
|
||||||
const { data } = this.props;
|
const { data } = this.props;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
if (typeof data.size !== 'undefined') {
|
if (Number.isSafeInteger(data.size)) {
|
||||||
count = data.size;
|
count = data.size;
|
||||||
} else {
|
} else {
|
||||||
for (const entry of data) { // eslint-disable-line no-unused-vars
|
for (const entry of data) { // eslint-disable-line no-unused-vars
|
||||||
|
|
Loading…
Reference in New Issue
Block a user