diff --git a/app/packages/utilities/src/size-bytes-estimate.test.ts b/app/packages/utilities/src/size-bytes-estimate.test.ts index f59adfc812..844dfb79a4 100644 --- a/app/packages/utilities/src/size-bytes-estimate.test.ts +++ b/app/packages/utilities/src/size-bytes-estimate.test.ts @@ -32,7 +32,7 @@ describe("sizeBytesEstimate tests", () => { expect(sizeBytesEstimate("chars")).toBe(10); }); - test("non-objects return 0", () => { - expect(sizeBytesEstimate(() => null)).toBe(0); + test("non-objects return non-zero", () => { + expect(sizeBytesEstimate(() => null)).toBe(1); }); }); diff --git a/app/packages/utilities/src/size-bytes-estimate.ts b/app/packages/utilities/src/size-bytes-estimate.ts index 8784f2ce52..c91c93b78f 100644 --- a/app/packages/utilities/src/size-bytes-estimate.ts +++ b/app/packages/utilities/src/size-bytes-estimate.ts @@ -64,5 +64,6 @@ const sizer = (object: SizerTypes) => { }; export default function sizeBytesEstimate(object: SizeTypes) { - return sizer(object); + // return value > 0; + return Math.max(sizer(object), 1); }