Skip to content

Commit fff7e39

Browse files
committed
using Number.isSafeInteger for iterable size (+ fixed some comments)
1 parent 11af53c commit fff7e39

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/react/JSONTree/JSONIterableNode.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default class JSONIterableNode extends React.Component {
5050
};
5151
}
5252

53-
// Returns the child nodes for each element in the array. If we have
53+
// Returns the child nodes for each entry in iterable. If we have
5454
// generated them previously, we return from cache, otherwise we create
5555
// them.
5656
getChildNodes() {
@@ -81,13 +81,13 @@ export default class JSONIterableNode extends React.Component {
8181
return this.renderedChildren;
8282
}
8383

84-
// Returns the "n Items" string for this node, generating and
84+
// Returns the "n entries" string for this node, generating and
8585
// caching it if it hasn't been created yet.
8686
getItemString() {
8787
if (!this.itemString) {
8888
const { data } = this.props;
8989
let count = 0;
90-
if (typeof data.size !== 'undefined') {
90+
if (Number.isSafeInteger(data.size)) {
9191
count = data.size;
9292
} else {
9393
for (const entry of data) { // eslint-disable-line no-unused-vars

0 commit comments

Comments
 (0)