This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function largeStringify<T>(resources: T[]): Promise<Buffer> { | |
const blobs = [new Blob(["["])]; | |
resources.forEach((resource, index) => { | |
const resourceString = JSON.stringify(resource); | |
blobs.push(new Blob([resourceString])); | |
if (index !== resources.length - 1) { | |
blobs.push(new Blob([","])); | |
} | |
}); | |