Skip to content

Commit

Permalink
fix: splitByLine
Browse files Browse the repository at this point in the history
  • Loading branch information
Dup4 committed Sep 15, 2022
1 parent f0adf1a commit e72174d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/internal/ThriftFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ThriftFormatter {
}

private deleteExtraEmptyLines(content: string): string {
const c = content.split("\n");
const c = this.splitByLine(content);
const res: string[] = [];

for (const l of c) {
Expand All @@ -48,6 +48,10 @@ class ThriftFormatter {

return res.join("\n");
}

private splitByLine(str: string): string[] {
return str.split(/\r?\n/);
}
}

export { ThriftFormatter };
Expand Down

0 comments on commit e72174d

Please sign in to comment.