SizeEstimate
SizeEstimate represents the estimated size range of a string, bytes, list, or map.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SizeEstimate(
Min,Max):SizeEstimate
Parameters
Section titled “Parameters”bigint
bigint
Returns
Section titled “Returns”SizeEstimate
Properties
Section titled “Properties”
readonlyMax:bigint
readonlyMin:bigint
Methods
Section titled “Methods”add(
other):SizeEstimate
add returns the sum of two size estimates with uint64 overflow protection.
Parameters
Section titled “Parameters”SizeEstimate
Returns
Section titled “Returns”SizeEstimate
asCost()
Section titled “asCost()”asCost():
CostEstimate
asCost converts a size range into an equivalent cost range.
Returns
Section titled “Returns”multiply()
Section titled “multiply()”multiply(
other):SizeEstimate
multiply returns the product of two size estimates with uint64 overflow protection.
Parameters
Section titled “Parameters”SizeEstimate
Returns
Section titled “Returns”SizeEstimate
multiplyByCost()
Section titled “multiplyByCost()”multiplyByCost(
cost):CostEstimate
multiplyByCost returns the product of a size range and a cost range.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”multiplyByCostFactor()
Section titled “multiplyByCostFactor()”multiplyByCostFactor(
costPerUnit):CostEstimate
multiplyByCostFactor converts the size range into a cost range using the provided factor.
Parameters
Section titled “Parameters”costPerUnit
Section titled “costPerUnit”number
Returns
Section titled “Returns”union()
Section titled “union()”union(
other):SizeEstimate
union returns the smallest estimate that covers both ranges.
Parameters
Section titled “Parameters”SizeEstimate
Returns
Section titled “Returns”SizeEstimate