MCPcopy Index your code
hub / github.com/nodejs/node / tap

Function tap

lib/internal/streams/iter/consumers.js:337–343  ·  view source on GitHub ↗

* Create a pass-through transform that observes chunks without modifying them. * @param {Function} callback * @returns {Function}

(callback)

Source from the content-addressed store, hash-verified

335 * @returns {Function}
336 */
337function tap(callback) {
338 validateFunction(callback, 'callback');
339 return async (chunks, options) => {
340 await callback(chunks, options);
341 return chunks;
342 };
343}
344
345/**
346 * Create a sync pass-through transform that observes chunks.

Callers 5

testTapCallbackErrorFunction · 0.85
testTapAsyncFunction · 0.85
testTapInPipelineFunction · 0.85

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected