Skip to content

Commit 004e5c0

Browse files
mscolnickpionxzh
andauthored
fix: update Object datatype for correct pluralization of Items (#531)
* Update Object datatype for correct pluralization of Items * Update Object.tsx Co-authored-by: Pionxzh <[email protected]> --------- Co-authored-by: Pionxzh <[email protected]>
1 parent 20ef810 commit 004e5c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/DataTypes/Object.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ function inspectMetadata (value: object) {
2626
if (Object.prototype.hasOwnProperty.call(value, Symbol.toStringTag)) {
2727
name = (value as any)[Symbol.toStringTag]
2828
}
29-
return `${length} Items${name ? ` (${name})` : ''}`
29+
const itemsPluralized = length === 1 ? 'Item' : 'Items'
30+
return `${length} ${itemsPluralized}${name ? ` (${name})` : ''}`
3031
}
3132

3233
const PreObjectType: FC<DataItemProps<object>> = (props) => {

0 commit comments

Comments
 (0)