mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Perf: speed up text line stream
This commit is contained in:
@@ -10,6 +10,7 @@ import { processLine } from './process-line';
|
||||
|
||||
const getReadableStream = (file: string | FileHandle): ReadableStream => {
|
||||
if (typeof file === 'string') {
|
||||
// return fs.openAsBlob(file).then(blob => blob.stream())
|
||||
return Readable.toWeb(fs.createReadStream(file/* , { encoding: 'utf-8' } */));
|
||||
}
|
||||
return file.readableWebStream();
|
||||
|
||||
Reference in New Issue
Block a user