(value: unknown)
| 68 | * Calculate the UTF-8 byte length of a value's JSON representation. |
| 69 | */ |
| 70 | const jsonBytes = (value: unknown): number => { |
| 71 | return utf8Bytes(JSON.stringify(value)); |
| 72 | }; |
| 73 | |
| 74 | /** |
| 75 | * Truncate a string to fit within maxBytes (inclusive) when encoded as UTF-8. |
no test coverage detected