Fix item strings

This commit is contained in:
Dan Abramov 2015-08-12 16:20:57 +03:00
parent 279480ac15
commit 78cf169aa6
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}