1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Clarify usages of event's toJSON

This commit is contained in:
J. Ryan Stinnett
2021-08-16 09:01:38 +01:00
parent 2f74779bf1
commit 0b12e37459

View File

@@ -1235,10 +1235,15 @@ export class MatrixEvent extends EventEmitter {
} }
/** /**
* Summarise the event as JSON for debugging. If encrypted, include both the * Summarise the event as JSON. This is currently used by React SDK's view
* decrypted and encrypted view of the event. This is named `toJSON` for use * event source feature and Seshat's event indexing, so take care when
* with `JSON.stringify` which checks objects for functions named `toJSON` * adjusting the output here.
* and will call them to customise the output if they are defined. *
* If encrypted, include both the decrypted and encrypted view of the event.
*
* This is named `toJSON` for use with `JSON.stringify` which checks objects
* for functions named `toJSON` and will call them to customise the output
* if they are defined.
* *
* @return {Object} * @return {Object}
*/ */