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 04f15f6 commit 11af53cCopy full SHA for 11af53c
src/react/JSONTree/JSONIterableNode.js
@@ -87,10 +87,12 @@ export default class JSONIterableNode extends React.Component {
87
if (!this.itemString) {
88
const { data } = this.props;
89
let count = 0;
90
- if (typeof data.count === 'function') {
91
- count = data.count();
+ if (typeof data.size !== 'undefined') {
+ count = data.size;
92
} else {
93
- count = data.length;
+ for (const entry of data) { // eslint-disable-line no-unused-vars
94
+ count += 1;
95
+ }
96
}
97
this.itemString = count + ' entr' + (count !== 1 ? 'ies' : 'y');
98
0 commit comments