From f15d108f22fa6178b185bd18fff50db539f32040 Mon Sep 17 00:00:00 2001 From: Myles Scolnick Date: Fri, 18 Oct 2024 14:17:37 -0400 Subject: [PATCH 1/2] Update Object datatype for correct pluralization of Items --- src/components/DataTypes/Object.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/DataTypes/Object.tsx b/src/components/DataTypes/Object.tsx index a5df25a4..6c3ab057 100644 --- a/src/components/DataTypes/Object.tsx +++ b/src/components/DataTypes/Object.tsx @@ -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> = (props) => { From da3b0a87f1cb18af14524384aae3a6ef49f7ab86 Mon Sep 17 00:00:00 2001 From: Myles Scolnick Date: Sat, 19 Oct 2024 09:55:02 -0400 Subject: [PATCH 2/2] Update Object.tsx Co-authored-by: Pionxzh --- src/components/DataTypes/Object.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DataTypes/Object.tsx b/src/components/DataTypes/Object.tsx index 6c3ab057..3d222af1 100644 --- a/src/components/DataTypes/Object.tsx +++ b/src/components/DataTypes/Object.tsx @@ -26,7 +26,7 @@ function inspectMetadata (value: object) { if (Object.prototype.hasOwnProperty.call(value, Symbol.toStringTag)) { name = (value as any)[Symbol.toStringTag] } - const itemsPluralized = length === 1 ? "Item" : "Items"; + const itemsPluralized = length === 1 ? 'Item' : 'Items' return `${length} ${itemsPluralized}${name ? ` (${name})` : ''}` }