mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Feat: ability to handle inline comment
This commit is contained in:
@@ -45,9 +45,11 @@ export function fetchRemoteTextByLine(url: string, processLine = false): Promise
|
||||
|
||||
export async function readFileIntoProcessedArray(file: string /* | FileHandle */) {
|
||||
const results = [];
|
||||
let processed: string | null = '';
|
||||
for await (const line of readFileByLine(file)) {
|
||||
if (processLine(line)) {
|
||||
results.push(line);
|
||||
processed = processLine(line);
|
||||
if (processed) {
|
||||
results.push(processed);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
||||
Reference in New Issue
Block a user