MCPcopy
hub / github.com/nodejs/undici / write

Method write

lib/cache/memory-cache-store.js:134–148  ·  view source on GitHub ↗
(chunk, encoding, callback)

Source from the content-addressed store, hash-verified

132
133 return new Writable({
134 write (chunk, encoding, callback) {
135 if (typeof chunk === 'string') {
136 chunk = Buffer.from(chunk, encoding)
137 }
138
139 entry.size += chunk.byteLength
140
141 if (entry.size > store.#maxEntrySize) {
142 this.destroy()
143 } else {
144 entry.body.push(chunk)
145 }
146
147 callback(null)
148 },
149 final (callback) {
150 let entries = store.#entries.get(topLevelKey)
151 if (!entries) {

Callers 3

handshakeMethod · 0.45
sendAuthRequestMethod · 0.45
connectMethod · 0.45

Calls 2

destroyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected