diff --git a/src/react/JSONTree/JSONArrayNode.js b/src/react/JSONTree/JSONArrayNode.js index f4e2f328..b7618735 100644 --- a/src/react/JSONTree/JSONArrayNode.js +++ b/src/react/JSONTree/JSONArrayNode.js @@ -76,7 +76,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 !== 0 ? 's' : ''); + this.itemString = this.props.data.length + ' item' + (this.props.data.length !== 1 ? 's' : ''); } return this.itemString; } diff --git a/src/react/JSONTree/JSONObjectNode.js b/src/react/JSONTree/JSONObjectNode.js index a1b55338..a829a634 100644 --- a/src/react/JSONTree/JSONObjectNode.js +++ b/src/react/JSONTree/JSONObjectNode.js @@ -78,7 +78,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 !== 0 ? 's' : ''); + this.itemString = len + ' key' + (len !== 1 ? 's' : ''); } return this.itemString; }