Skip to content

Commit 2421bdb

Browse files
committed
nit
1 parent f28ed9a commit 2421bdb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

frontend/src/lib/components/DisplayResult.svelte

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,20 @@
149149
)
150150
}
151151
152-
function isTableRowObjectWithoutHeaders(json: any, checkFirst) {
152+
function isTableRowObjectWithoutHeaders(json: any, skipMaxColCheck: boolean) {
153153
return (
154154
Array.isArray(json) &&
155155
json.length > 0 &&
156-
(!checkFirst ||
157-
(json[0] && typeof json[0] === 'object' && Object.keys(json[0]).length <= 100)) &&
158156
json.every((item) => {
159-
return typeof item === 'object' && Object.keys(item).length > 0 && !Array.isArray(item)
157+
if (item && typeof item === 'object') {
158+
let keys = Object.keys(item)
159+
if (keys.length > 0 && !Array.isArray(item)) {
160+
if (skipMaxColCheck || keys.length <= 100) {
161+
return true
162+
}
163+
}
164+
}
165+
return false
160166
})
161167
)
162168
}

0 commit comments

Comments
 (0)