Skip to content

Commit

Permalink
fix: Remove Blob usage to support modern browsers
Browse files Browse the repository at this point in the history
closes #325
  • Loading branch information
sebbo2002 committed Nov 4, 2021
1 parent c0c3d4d commit c4e33d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export function foldLines (input: string): string {
ch += line.charAt(++i);
}

const charsize = Buffer.from(ch).length;
// TextEncoder is available in browsers and node.js >= 11.0.0
const charsize = new TextEncoder().encode(ch).length;
c += charsize;
if (c > 74) {
result += '\r\n ';
Expand Down

0 comments on commit c4e33d3

Please sign in to comment.