MCPcopy
hub / github.com/koajs/koa / cleanupPreviousStream

Function cleanupPreviousStream

lib/response.js:139–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137 this._body = val
138
139 const cleanupPreviousStream = () => {
140 if (original && isStream(original)) {
141 original.once('error', () => {})
142 // Only destroy if the new value is not a stream
143 if (!isStream(val)) {
144 destroy(original)
145 }
146 }
147 }
148
149 // no content
150

Callers 1

bodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…