mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-24 06:14:01 +08:00
deflateSync, inflateSync, gzipSync, gunzipSync, deflateRawSync, inflateRawSync and unzipSync, and their callback forms, accept Node's options and run Node's processChunkSync over the zlib stream engine. - Options (windowBits, level, memLevel, strategy, dictionary, chunkSize, finishFlush, maxOutputLength, rejectGarbageAfterEnd) are validated at run time with Node's ladder, shared with the stream classes; info is refused at run time. - Errors carry Node's errno and code; maxOutputLength reports ERR_BUFFER_TOO_LARGE and rejectGarbageAfterEnd ERR_TRAILING_JUNK_AFTER_STREAM_END. The default-options decoders also read every gzip member. - Untyped JavaScript inputs may be strings, TypedArrays, DataViews or ArrayBuffers; other values throw Node's ERR_INVALID_ARG_TYPE after the options are checked. - Results are Buffers, as in Node: they convert to their text. Corpus programs 5378, 5379 and 5415 cover the sync, callback and untyped input forms.