encodeStateBounded
functionsignature
encodeStateBounded(input, maxBytes, options): BoundedEncodeResultEncodes a value, shrinking it until its serialized form fits within maxBytes.
Parameters
| Name | Type | Description |
|---|---|---|
input | unknown | Any value. |
| Name | Type | Description |
|---|---|---|
maxBytes | number | Byte budget for the serialized form. |
| Name | Type | Description |
|---|---|---|
options | EncodeOptions | Passed through to encodeState. |
Returns
BoundedEncodeResult — The encoded value and whether anything had to be dropped.