Function: encode()
ts
function encode<T>(what: T): string;Encodes a value into a compressed base64 string
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends Encodable | Encodable |
Parameters
| Parameter | Type | Description |
|---|---|---|
what | T | The value to be encoded |
Returns
string
A compressed base64 string representing the encoded value
Throws
E_ENCODING_FAILED When the value cannot be encoded
Throws
E_CIRCULAR_REFERENCE When the value contains dangerous circular references
Throws
E_UNENCODABLE_VALUE When the value contains unencodable data types