Skip to content

Commit

Permalink
Update Object datatype for correct pluralization of Items
Browse files Browse the repository at this point in the history
  • Loading branch information
mscolnick authored Oct 18, 2024
1 parent 20ef810 commit f15d108
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";

Check failure on line 29 in src/components/DataTypes/Object.tsx

View workflow job for this annotation

GitHub Actions / Running vitest

Strings must use singlequote

Check failure on line 29 in src/components/DataTypes/Object.tsx

View workflow job for this annotation

GitHub Actions / Running vitest

Strings must use singlequote

Check failure on line 29 in src/components/DataTypes/Object.tsx

View workflow job for this annotation

GitHub Actions / Running vitest

Extra semicolon
return `${length} ${itemsPluralized}${name ? ` (${name})` : ''}`
}

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

0 comments on commit f15d108

Please sign in to comment.