diff --git a/src/react/JSONTree/JSONArrayNode.js b/src/react/JSONTree/JSONArrayNode.js index c1a7c93a..0ac2b145 100644 --- a/src/react/JSONTree/JSONArrayNode.js +++ b/src/react/JSONTree/JSONArrayNode.js @@ -73,7 +73,7 @@ export default class JSONArrayNode extends React.Component { // caching it if it hasn't been created yet. getItemString() { if (!this.itemString) { - this.itemString = this.props.data.length + ' item' + (this.props.data.length > 1 ? 's' : ''); + this.itemString = this.props.data.length + ' item' + (this.props.data.length !== 0 ? 's' : ''); } return this.itemString; } diff --git a/src/react/JSONTree/JSONObjectNode.js b/src/react/JSONTree/JSONObjectNode.js index e7d0db2d..3c319cd0 100644 --- a/src/react/JSONTree/JSONObjectNode.js +++ b/src/react/JSONTree/JSONObjectNode.js @@ -76,7 +76,7 @@ export default class JSONObjectNode extends React.Component { getItemString() { if (!this.itemString) { const len = Object.keys(this.props.data).length; - this.itemString = len + ' key' + (len > 1 ? 's' : ''); + this.itemString = len + ' key' + (len !== 0 ? 's' : ''); } return this.itemString; }