mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-01-23 00:06:08 +01:00
replaced structuredClone, fixed download single
This commit is contained in:
parent
85d61fddf0
commit
063acc6bbf
@ -216,7 +216,7 @@ async function downloadHandler(res: Response, pdfResults: PdfFile[]) {
|
||||
}
|
||||
else {
|
||||
const readStream = new stream.PassThrough();
|
||||
readStream.end(pdfResults[0].uint8Array);
|
||||
readStream.end(await pdfResults[0].uint8Array);
|
||||
|
||||
// TODO: Implement other file types (mostly fro image & text extraction)
|
||||
res.set("Content-disposition", 'attachment; filename=' + pdfResults[0].filename + ".pdf");
|
||||
|
@ -26,12 +26,12 @@ export async function * traverseOperations(operations: Action[], input: PdfFile[
|
||||
}
|
||||
|
||||
for (let i = 0; i < actions.length; i++) {
|
||||
yield* computeOperation(actions[i], input); // TODO: structuredClone doesn't work in ts need to find another solution to pass by value.
|
||||
yield* computeOperation(actions[i], Object.assign([], input)); // structuredClone-like for ts TODO: test if this really works
|
||||
}
|
||||
}
|
||||
|
||||
async function * computeOperation(action: Action, input: PdfFile|PdfFile[]): AsyncGenerator<string, void, void> {
|
||||
|
||||
console.log("Input: ", input);
|
||||
yield "Starting: " + action.type;
|
||||
switch (action.type) {
|
||||
case "done": // Skip this, because it is a valid node.
|
||||
|
Loading…
Reference in New Issue
Block a user