Files
klz-cables.com/.pnpm-store/v10/files/69/560b82d9b582b931b696d0a5b7e960c824c9935e6c699bd5b75f8d853901c23f3f2a2cca9c2eb0750096c1cae33e6d83a380e7bdc739ce589b6887e57c71ee
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

22 lines
852 B
Plaintext

import { stat as fsStat } from 'node:fs/promises';
import { fromStream as coreFromStream } from './core.js';
export { fromFile } from './FileTokenizer.js';
export * from './core.js';
/**
* Construct ReadStreamTokenizer from given Stream.
* Will set fileSize, if provided given Stream has set the .path property.
* @param stream - Node.js Stream.Readable
* @param options - Pass additional file information to the tokenizer
* @returns Tokenizer
*/
export async function fromStream(stream, options) {
const augmentedOptions = options ?? {};
augmentedOptions.fileInfo = augmentedOptions.fileInfo ?? {};
if (stream.path) {
const stat = await fsStat(stream.path);
augmentedOptions.fileInfo.path = stream.path;
augmentedOptions.fileInfo.size = stat.size;
}
return coreFromStream(stream, augmentedOptions);
}