writeJSON(embed) {
    encoding.writeAny(this.restEncoder, embed);
  }
This is mainly here for legacy purposes.

Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.

@param {any} embed