'use strict';

var exports = module.exports = {};

var Response = exports.Response = function Response(channel) {
  this.channel = channel;
  this.data = '';
  this.sent = false;
};

Response.prototype.write = function write(data) {
  this.data += data;
};

Response.prototype.end = function end(data) {
  if (!this.sent) {
    this.data += (data || '');
    this.channel.send(this.data);
    this.sent = true;
  }
};

@@ -48,59 +48,38 @@
 %7D;%0A%0A
-var Response = exports.Response = function Response
+class Response %7B%0A  constructor
 (cha
@@ -82,24 +82,26 @@
 (channel) %7B%0A
+  
   this.chann
@@ -112,24 +112,26 @@
  channel;%0A  
+ 
+ 
 this.data = 
@@ -134,16 +134,18 @@
 a = '';%0A
+  
   this.s
@@ -161,47 +161,14 @@
 se;%0A
-%7D;%0A%0AResponse.prototype.write = function
+  %7D%0A%0A 
  wri
@@ -178,16 +178,18 @@
 data) %7B%0A
+  
   this.d
@@ -205,45 +205,14 @@
 ta;%0A
-%7D;%0A%0AResponse.prototype.end = function
+  %7D%0A%0A 
  end
@@ -220,16 +220,18 @@
 data) %7B%0A
+  
   if (!t
@@ -238,20 +238,30 @@
 his.sent
+ && data
 ) %7B%0A
+  
     this
@@ -273,22 +273,16 @@
  += 
-(
 data
- %7C%7C '')
 ;%0A
+  
     
@@ -311,24 +311,26 @@
 .data);%0A    
+  
 this.sent = 
@@ -339,11 +339,46 @@
 ue;%0A
+  
   %7D%0A
-%7D
+  %7D%0A%7D%0A%0Aexports.response = Response
 ;%0A

Convert response to ES6 class