@dxos/echo
    Preparing search index...

    Function toJSON

    • Converts object to its JSON representation. Accepts both reactive objects and snapshots.

      JSON.stringify(obj) gives the same result for an in-memory object, which shares this serializer. A database-backed object carries its own toJSON, which reads the document rather than the target and still differs in two ways: it omits @uri, and it leaves Uint8Array values unencoded. Prefer this function where the two must agree.

      Parameters

      Returns ObjectJSON

      O(n) in entity size; serializes the whole entity on every call.