extendClient
Extends a client object with additional properties, preserving property descriptors (getters, symbol-keyed properties, and non-enumerable properties) from both objects.
Use this inside plugins instead of plain object spread ({...client, ...additions})
when the client may carry getters or symbol-keyed properties that spread would flatten or lose.
When the same key exists on both, additions wins.
Type Parameters
| Type Parameter | Description |
|---|---|
TClient extends object | The type of the original client. |
TAdditions extends object | The type of the properties being added. |
Parameters
| Parameter | Type | Description |
|---|---|---|
client | TClient | The original client object to extend. |
additions | TAdditions | The properties to add or override on the client. |
Returns
Omit<TClient, keyof TAdditions> & TAdditions
A new object combining both, with additions taking precedence on conflicts.