Skip to content

Commit f6d4982

Browse files
fanatidMyles Borins
authored and
Myles Borins
committed
doc: clarify type of first argument in zlib
The current documentation for Convenience Methods specifies that the first argument can be either `string or buffer`, `string` or `raw Buffer`. This commit replaces all these instances with `Buffer or string`. PR-URL: #5685 Reviewed-By: Claudio Rodriguez <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 07e71b2 commit f6d4982

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

doc/api/zlib.markdown

+11-16
Original file line numberDiff line numberDiff line change
@@ -324,53 +324,47 @@ Returns a new [Unzip][] object with an [options][].
324324

325325
<!--type=misc-->
326326

327-
All of these take a string or buffer as the first argument, an optional second
327+
All of these take a [Buffer][] or string as the first argument, an optional second
328328
argument to supply options to the zlib classes and will call the supplied
329329
callback with `callback(error, result)`.
330330

331331
Every method has a `*Sync` counterpart, which accept the same arguments, but
332332
without a callback.
333333

334334
### zlib.deflate(buf[, options], callback)
335+
### zlib.deflateSync(buf[, options])
335336

336-
Compress a string with Deflate.
337+
Compress a Buffer or string with Deflate.
337338

338339
### zlib.deflateRaw(buf[, options], callback)
339340
### zlib.deflateRawSync(buf[, options])
340341

341-
Compress a string with DeflateRaw.
342-
343-
### zlib.deflateSync(buf[, options])
344-
345-
Compress a string with Deflate.
342+
Compress a Buffer or string with DeflateRaw.
346343

347344
### zlib.gunzip(buf[, options], callback)
348345
### zlib.gunzipSync(buf[, options])
349346

350-
Decompress a raw Buffer with Gunzip.
347+
Decompress a Buffer or string with Gunzip.
351348

352349
### zlib.gzip(buf[, options], callback)
353350
### zlib.gzipSync(buf[, options])
354351

355-
Compress a string with Gzip.
352+
Compress a Buffer or string with Gzip.
356353

357354
### zlib.inflate(buf[, options], callback)
355+
### zlib.inflateSync(buf[, options])
358356

359-
Decompress a raw Buffer with Inflate.
357+
Decompress a Buffer or string with Inflate.
360358

361359
### zlib.inflateRaw(buf[, options], callback)
362360
### zlib.inflateRawSync(buf[, options])
363361

364-
Decompress a raw Buffer with InflateRaw.
365-
366-
### zlib.inflateSync(buf[, options])
367-
368-
Decompress a raw Buffer with Inflate.
362+
Decompress a Buffer or string with InflateRaw.
369363

370364
### zlib.unzip(buf[, options], callback)
371365
### zlib.unzipSync(buf[, options])
372366

373-
Decompress a raw Buffer with Unzip.
367+
Decompress a Buffer or string with Unzip.
374368

375369
[accept-encoding]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3
376370
[content-encoding]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
@@ -384,3 +378,4 @@ Decompress a raw Buffer with Unzip.
384378
[Inflate]: #zlib_class_zlib_inflate
385379
[InflateRaw]: #zlib_class_zlib_inflateraw
386380
[Unzip]: #zlib_class_zlib_unzip
381+
[Buffer]: buffer.html

0 commit comments

Comments
 (0)