You've already forked matrix-js-sdk
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:
@@ -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}
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user