writeTypedObject(value) {
    const idx = this.references.indexOf(value)

    if (idx >= 0) {
      return this.writeReference(idx)
    }

    this.references.push(value)

    this.buffer.writeByte(Markers.AMF0.TYPED_OBJECT)
    this.writeString(value.constructor.name)

    for (const key in value) {
      this.writeString(key)
      this.writeData(value[key])
    }

    this.buffer.writeUnsignedShort(0)
    this.buffer.writeByte(Markers.AMF0.OBJECT_END)
  }
/**
   * Writes an AMF0 typed object
   * @param {Object} value
   */
Writes an AMF0 typed object
@param {Object} value
Writes an AMF0 typed object @param { Object } value
writeTypedObject(value) {
    const idx = this.references.indexOf(value)
    if (idx >= 0) {
      return this.writeReference(idx)
    }
    this.references.push(value)
    this.buffer.writeByte(Markers.AMF0.TYPED_OBJECT)
    this.writeString(value.constructor.name)
    for (const key in value) {
      this.writeString(key)
      this.writeData(value[key])
    }
    this.buffer.writeUnsignedShort(0)
    this.buffer.writeByte(Markers.AMF0.OBJECT_END)
  }
writeTypedObject ( value ) { const idx = this . references . indexOf ( value ) if ( idx >= 0 ) { return this . writeReference ( idx ) } this . references . push ( value ) this . buffer . writeByte ( Markers . AMF0 . TYPED_OBJECT ) this . writeString ( value . constructor . name ) for ( const key in value ) { this . writeString ( key ) this . writeData ( value [ key ] ) } this . buffer . writeUnsignedShort ( 0 ) this . buffer . writeByte ( Markers . AMF0 . OBJECT_END ) }
Writes an AMF0 typed object
 @param {Object} value
Writes an AMF0 typed object @param { Object } value