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

Function cleanupPreviousStream

lib/response.js:139–147  ·  lib/response.js::cleanupPreviousStream
()

Source from the content-addressed store, hash-verified

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

Callers 1

bodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected