8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 487aa31 + a87b573 commit 75b015dCopy full SHA for 75b015d
lib/diff.js
@@ -72,7 +72,7 @@ Diff.blobToBuffer= function(
72
var bufferLength;
73
if (buffer instanceof Buffer) {
74
bufferText = buffer.toString("utf8");
75
- bufferLength = buffer.length;
+ bufferLength = Buffer.byteLength(buffer, "utf8");
76
} else {
77
bufferText = buffer;
78
bufferLength = !buffer ? 0 : Buffer.byteLength(buffer, "utf8");
@@ -84,7 +84,7 @@ Diff.blobToBuffer= function(
84
this,
85
old_blob,
86
old_as_path,
87
- buffer,
+ bufferText,
88
bufferLength,
89
buffer_as_path,
90
opts,
0 commit comments