mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Also split on unicode line and paragraph separators
This commit is contained in:
parent
df8bb9be74
commit
fe39b9cc23
1 changed files with 1 additions and 1 deletions
|
|
@ -28,7 +28,7 @@ export function removeLinesMatchingPattern(filePath, pattern) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileContent = fs.readFileSync(filePath, "utf-8");
|
const fileContent = fs.readFileSync(filePath, "utf-8");
|
||||||
const lines = fileContent.split(/[\r\n]+/);
|
const lines = fileContent.split(/[\r\n\u2028\u2029]+/);
|
||||||
const updatedLines = lines.filter((line) => !shouldRemoveLine(line, pattern));
|
const updatedLines = lines.filter((line) => !shouldRemoveLine(line, pattern));
|
||||||
fs.writeFileSync(filePath, updatedLines.join(os.EOL), "utf-8");
|
fs.writeFileSync(filePath, updatedLines.join(os.EOL), "utf-8");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue