Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Object datatype for correct pluralization of Items #531

Merged
merged 2 commits into from
Oct 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
mscolnick marked this conversation as resolved.
Show resolved Hide resolved
return `${length} ${itemsPluralized}${name ? ` (${name})` : ''}`
}

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