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

Function createConvenienceMethod

lib/zlib.js:786–799  ·  view source on GitHub ↗
(ctor, sync)

Source from the content-addressed store, hash-verified

784ObjectSetPrototypeOf(Unzip, Zlib);
785
786function createConvenienceMethod(ctor, sync) {
787 if (sync) {
788 return function syncBufferWrapper(buffer, opts) {
789 return zlibBufferSync(new ctor(opts), buffer);
790 };
791 }
792 return function asyncBufferWrapper(buffer, opts, callback) {
793 if (typeof opts === 'function') {
794 callback = opts;
795 opts = {};
796 }
797 return zlibBuffer(new ctor(opts), buffer, callback);
798 };
799}
800
801const kMaxBrotliParam = MathMax(
802 ...ObjectEntries(constants)

Callers 1

zlib.jsFile · 0.85

Calls 2

zlibBufferSyncFunction · 0.85
zlibBufferFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…