Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 12 additions & 10 deletions apps/web/src/components/containers/TableView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,14 @@ function toTable(
}

if (Array.isArray(value)) {
const objectRows = value.every(
(item) =>
item !== null && typeof item === "object" && !Array.isArray(item),
);
if (!objectRows || value.length === 0) {
if (value.length === 0) {
return;
}
for (const item of value) {
if (item === null || typeof item !== "object" || Array.isArray(item)) {
return;
}
}
const columns = collectColumns(value as Record<string, JsonValue>[]);
return {
columns,
Expand All @@ -311,13 +312,14 @@ function toTable(

if (value !== null && typeof value === "object") {
const entries = Object.entries(value);
const objectRows = entries.every(
([, item]) =>
item !== null && typeof item === "object" && !Array.isArray(item),
);
if (!objectRows || entries.length === 0) {
if (entries.length === 0) {
return;
}
for (const [, item] of entries) {
if (item === null || typeof item !== "object" || Array.isArray(item)) {
return;
}
}
const objects = entries.map(
([, item]) => item as Record<string, JsonValue>,
);
Expand Down
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.4/schema.json",
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"root": true,
"extends": [
"ultracite/biome/core",
"ultracite/biome/react",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Dean Grant",
"description": "Browser JSON editor monorepo — domain core and web app.",
"devDependencies": {
"@biomejs/biome": "2.5.4",
"@biomejs/biome": "2.5.5",
"react-doctor": "0.8.1",
"typescript": "catalog:",
"ultracite": "7.9.4"
Expand Down
82 changes: 41 additions & 41 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.