Files
klz-cables.com/.pnpm-store/v10/files/6c/43ee9fb8d15a374845ab7d7d1aeedf48958c7135297e25535b2fcc1d25317f87c855ecb094e63e441585cea6d0844bdcf5cc5a2095d7837acc5e427537d78f
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

25 lines
724 B
Plaintext

import fs from 'fs';
export function iteratorToStream(iterator) {
return new ReadableStream({
async pull (controller) {
const { done, value } = await iterator.next();
if (done) {
controller.close();
} else {
controller.enqueue(value);
}
}
});
}
export async function* nodeStreamToIterator(stream) {
for await (const chunk of stream){
yield new Uint8Array(chunk);
}
}
export function streamFile({ filePath, options }) {
const nodeStream = fs.createReadStream(filePath, options);
const data = iteratorToStream(nodeStreamToIterator(nodeStream));
return data;
}
//# sourceMappingURL=index.js.map