Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
export const RETAINED_STRING_CHUNK_LIMIT = 1_024
|
||||
|
||||
export function appendCompactedStringChunk(chunks: string[], value: string): void {
|
||||
chunks.push(value)
|
||||
if (chunks.length <= RETAINED_STRING_CHUNK_LIMIT) {
|
||||
return
|
||||
}
|
||||
const compacted = chunks.join('')
|
||||
chunks.length = 0
|
||||
chunks.push(compacted)
|
||||
}
|
||||
Reference in New Issue
Block a user