Housekeeping

This commit is contained in:
SukkaW
2026-08-20 22:54:47 +08:00
parent 53634aab1d
commit b1d0f4bcc2
6 changed files with 66 additions and 65 deletions

View File

@@ -18,7 +18,7 @@ const fileEqual = createCompareSource(fileEqualWithCommentComparator);
*/
async function isPreviousOutputEqual(span: Span, linesA: string[], filePath: string, contentHash: string | null) {
// readFileByLine will not include last empty line. So we always pop the linesA for comparison purpose
if (linesA.length > 0 && linesA[linesA.length - 1] === '') {
if (linesA.length > 0 && linesA.at(-1) === '') {
linesA.pop();
}