@google-cloud/nodejs-common 2.0.1-alpha → 2.0.2-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -124,9 +124,12 @@ class StorageFile {
|
|
|
124
124
|
checkPoint = Math.max(start, end - possibleLineBreakRange + 1);
|
|
125
125
|
}
|
|
126
126
|
const content = await this.loadContent(checkPoint, end);
|
|
127
|
-
|
|
127
|
+
let i = 0;
|
|
128
|
+
while (content.charCodeAt(i) === 0xFFFD) i++;
|
|
129
|
+
const cleanedContent = i > 0 ? content.slice(i) : content;
|
|
130
|
+
const index = Buffer.from(cleanedContent).lastIndexOf(LINE_BREAKER);
|
|
128
131
|
if (index >= 0) {
|
|
129
|
-
return checkPoint + index;
|
|
132
|
+
return checkPoint + i + index;
|
|
130
133
|
}
|
|
131
134
|
if (checkPoint > start) {
|
|
132
135
|
return this.getLastLineBreaker(
|
|
@@ -252,3 +255,4 @@ module.exports = {
|
|
|
252
255
|
LINE_BREAKER,
|
|
253
256
|
DEFAULT_SPLIT_SIZE,
|
|
254
257
|
};
|
|
258
|
+
|