This commit is contained in:
dzannotti 2015-08-10 23:33:31 +01:00
parent 7ad9616777
commit 696b3bbc7f
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ export default class JSONArrayNode extends React.Component {
// 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) {
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; return this.itemString;
} }

View File

@ -76,7 +76,7 @@ export default class JSONObjectNode extends React.Component {
getItemString() { getItemString() {
if (!this.itemString) { if (!this.itemString) {
const len = Object.keys(this.props.data).length; 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; return this.itemString;
} }