(chunk)
| 38 | writableEnded: false, |
| 39 | write(chunk) { this.body += String(chunk); return true; }, |
| 40 | end(chunk) { |
| 41 | if (chunk) this.write(chunk); |
| 42 | this.writableEnded = true; |
| 43 | for (const cb of listeners.get('close') || []) cb(); |
| 44 | }, |
| 45 | on(event, cb) { |
| 46 | if (!listeners.has(event)) listeners.set(event, []); |
| 47 | listeners.get(event).push(cb); |