Skip to content

Commit

Permalink
fix: update Object datatype for correct pluralization of Items (#531)
Browse files Browse the repository at this point in the history
* Update Object datatype for correct pluralization of Items

* Update Object.tsx

Co-authored-by: Pionxzh <[email protected]>

---------

Co-authored-by: Pionxzh <[email protected]>
  • Loading branch information
mscolnick and pionxzh authored Oct 19, 2024
1 parent 20ef810 commit 004e5c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/DataTypes/Object.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ function inspectMetadata (value: object) {
if (Object.prototype.hasOwnProperty.call(value, Symbol.toStringTag)) {
name = (value as any)[Symbol.toStringTag]
}
return `${length} Items${name ? ` (${name})` : ''}`
const itemsPluralized = length === 1 ? 'Item' : 'Items'
return `${length} ${itemsPluralized}${name ? ` (${name})` : ''}`
}

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

0 comments on commit 004e5c0

Please sign in to comment.