1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-11 00:10:06 +00:00

fix(log): fixed single chunk display

This commit is contained in:
Yury Shkoda
2023-04-18 15:46:53 +03:00
parent 75f5a3c0b3
commit 8254b78955
3 changed files with 23 additions and 13 deletions

View File

@@ -81,11 +81,11 @@ export const isTheLastChunk = (
}
export const splitIntoChunks = (log: string, chunkSize = defaultChunkSize) => {
if (!log.length) return []
if (!log) return []
const logLines: string[] = log.split(`\n`)
if (logLines.length <= chunkSize) return log
if (logLines.length <= chunkSize) return [log]
const chunks: string[] = []