Skip to content

Commit 364127c

Browse files
authored
Fix maximum call stack size exceeded for csv export (#1963)
* Fix maximum call stack size exceeded for csv export * refactor
1 parent cbc2b59 commit 364127c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/browser/modules/Stream/CypherFrame/CypherFrame.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,10 @@ export class CypherFrame extends Component<CypherFrameProps, CypherFrameState> {
427427
const firstRecord = records[0]
428428
const keys = firstRecord?.length > 0 ? firstRecord.keys : []
429429

430-
const exportdataRaw = [keys]
431-
exportdataRaw.push(
432-
...(records.map(record => recordToStringArray(record)) as any)
430+
const exportData = stringifyResultArray(
431+
csvFormat,
432+
[keys].concat(records.map(record => recordToStringArray(record)))
433433
)
434-
const exportData = stringifyResultArray(csvFormat, exportdataRaw)
435434
const data = exportData.slice()
436435
const csv = CSVSerializer(data.shift())
437436
csv.appendRows(data)

0 commit comments

Comments
 (0)