Skip to content

Commit ef5a56e

Browse files
committed
fix(lib-storage): remove converting zero to undefined for zero byte length
1 parent d4325dd commit ef5a56e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/lib-storage/src/Upload.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ describe(Upload.name, () => {
859859

860860
expect(() => {
861861
(upload as any).__validateUploadPart(emptyPart, MOCK_PART_SIZE);
862-
}).toThrow("A dataPart was generated without a measurable data chunk size for part number 1");
862+
}).toThrow(`The byte size for part number 1, size 0 does not match expected size ${MOCK_PART_SIZE}`);
863863
});
864864

865865
it("should skip validation for single-part uploads", () => {

lib/lib-storage/src/Upload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export class Upload extends EventEmitter {
438438
}
439439

440440
private __validateUploadPart(dataPart: RawDataPart): void {
441-
const actualPartSize = byteLength(dataPart.data) || undefined;
441+
const actualPartSize = byteLength(dataPart.data);
442442

443443
if (actualPartSize === undefined) {
444444
throw new Error(

0 commit comments

Comments
 (0)