File
Blob: src/node/zlib.ts
| 1 | // Copyright (c) 2017-2022 Cloudflare, Inc. |
| 2 | // Licensed under the Apache 2.0 license found in the LICENSE file or at: |
| 3 | // https://opensource.org/licenses/Apache-2.0 |
| 4 | // Copyright Joyent and Node contributors. All rights reserved. MIT license. |
| 5 | |
| 6 | import * as zlib from 'node-internal:internal_zlib'; |
| 7 | import { crc32 } from 'node-internal:internal_zlib'; |
| 8 | import { constants, codes } from 'node-internal:internal_zlib_constants'; |
| 9 | |
| 10 | const nodeJsZlib = !!Cloudflare.compatibilityFlags['nodejs_zlib']; |
| 11 | const { |
| 12 | Z_NO_FLUSH, |
| 13 | Z_PARTIAL_FLUSH, |
| 14 | Z_SYNC_FLUSH, |
| 15 | Z_FULL_FLUSH, |
| 16 | Z_FINISH, |
| 17 | Z_BLOCK, |
| 18 | |
| 19 | Z_OK, |
| 20 | Z_STREAM_END, |
| 21 | Z_NEED_DICT, |
| 22 | Z_ERRNO, |
| 23 | Z_STREAM_ERROR, |
| 24 | Z_DATA_ERROR, |
| 25 | Z_MEM_ERROR, |
| 26 | Z_BUF_ERROR, |
| 27 | Z_VERSION_ERROR, |
| 28 | |
| 29 | Z_NO_COMPRESSION, |
| 30 | Z_BEST_SPEED, |
| 31 | Z_BEST_COMPRESSION, |
| 32 | Z_DEFAULT_COMPRESSION, |
| 33 | Z_FILTERED, |
| 34 | Z_HUFFMAN_ONLY, |
| 35 | Z_RLE, |
| 36 | Z_FIXED, |
| 37 | Z_DEFAULT_STRATEGY, |
| 38 | ZLIB_VERNUM, |
| 39 | |
| 40 | DEFLATE, |
| 41 | INFLATE, |
| 42 | GZIP, |
| 43 | GUNZIP, |
| 44 | DEFLATERAW, |
| 45 | INFLATERAW, |
| 46 | UNZIP, |
| 47 | BROTLI_DECODE, |
| 48 | BROTLI_ENCODE, |
| 49 | ZSTD_ENCODE, |
| 50 | ZSTD_DECODE, |
| 51 | ZSTD_COMPRESS, |
| 52 | ZSTD_DECOMPRESS, |
| 53 | |
| 54 | Z_MIN_WINDOWBITS, |
| 55 | Z_MAX_WINDOWBITS, |
| 56 | Z_DEFAULT_WINDOWBITS, |
| 57 | Z_MIN_CHUNK, |
| 58 | Z_MAX_CHUNK, |
| 59 | Z_DEFAULT_CHUNK, |
| 60 | Z_MIN_MEMLEVEL, |
| 61 | Z_MAX_MEMLEVEL, |
| 62 | Z_DEFAULT_MEMLEVEL, |
| 63 | Z_MIN_LEVEL, |
| 64 | Z_MAX_LEVEL, |
| 65 | Z_DEFAULT_LEVEL, |
| 66 | |
| 67 | BROTLI_OPERATION_PROCESS, |
| 68 | BROTLI_OPERATION_FLUSH, |
| 69 | BROTLI_OPERATION_FINISH, |
| 70 | BROTLI_OPERATION_EMIT_METADATA, |
| 71 | BROTLI_PARAM_MODE, |
| 72 | BROTLI_MODE_GENERIC, |
| 73 | BROTLI_MODE_TEXT, |
| 74 | BROTLI_MODE_FONT, |
| 75 | BROTLI_DEFAULT_MODE, |
| 76 | BROTLI_PARAM_QUALITY, |
| 77 | BROTLI_MIN_QUALITY, |
| 78 | BROTLI_MAX_QUALITY, |
| 79 | BROTLI_DEFAULT_QUALITY, |
| 80 | BROTLI_PARAM_LGWIN, |
| 81 | BROTLI_MIN_WINDOW_BITS, |
| 82 | BROTLI_MAX_WINDOW_BITS, |
| 83 | BROTLI_LARGE_MAX_WINDOW_BITS, |
| 84 | BROTLI_DEFAULT_WINDOW, |
| 85 | BROTLI_PARAM_LGBLOCK, |
| 86 | BROTLI_MIN_INPUT_BLOCK_BITS, |
| 87 | BROTLI_MAX_INPUT_BLOCK_BITS, |
| 88 | BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING, |
| 89 | BROTLI_PARAM_LARGE_WINDOW, |
| 90 | BROTLI_PARAM_NPOSTFIX, |
| 91 | BROTLI_PARAM_NDIRECT, |
| 92 | BROTLI_DECODER_RESULT_ERROR, |
| 93 | BROTLI_DECODER_RESULT_SUCCESS, |
| 94 | BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT, |
| 95 | BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT, |
| 96 | BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION, |
| 97 | BROTLI_DECODER_PARAM_LARGE_WINDOW, |
| 98 | BROTLI_DECODER_NO_ERROR, |
| 99 | BROTLI_DECODER_SUCCESS, |
| 100 | BROTLI_DECODER_NEEDS_MORE_INPUT, |
| 101 | BROTLI_DECODER_NEEDS_MORE_OUTPUT, |
| 102 | BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE, |
| 103 | BROTLI_DECODER_ERROR_FORMAT_RESERVED, |
| 104 | BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE, |
| 105 | BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET, |
| 106 | BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME, |
| 107 | BROTLI_DECODER_ERROR_FORMAT_CL_SPACE, |
| 108 | BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE, |
| 109 | BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT, |
| 110 | BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1, |
| 111 | BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2, |
| 112 | BROTLI_DECODER_ERROR_FORMAT_TRANSFORM, |
| 113 | BROTLI_DECODER_ERROR_FORMAT_DICTIONARY, |
| 114 | BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS, |
| 115 | BROTLI_DECODER_ERROR_FORMAT_PADDING_1, |
| 116 | BROTLI_DECODER_ERROR_FORMAT_PADDING_2, |
| 117 | BROTLI_DECODER_ERROR_FORMAT_DISTANCE, |
| 118 | BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET, |
| 119 | BROTLI_DECODER_ERROR_INVALID_ARGUMENTS, |
| 120 | BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES, |
| 121 | BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS, |
| 122 | BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP, |
| 123 | BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1, |
| 124 | BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2, |
| 125 | BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES, |
| 126 | BROTLI_DECODER_ERROR_UNREACHABLE, |
| 127 | ZSTD_error_no_error, |
| 128 | ZSTD_error_GENERIC, |
| 129 | ZSTD_error_prefix_unknown, |
| 130 | ZSTD_error_version_unsupported, |
| 131 | ZSTD_error_frameParameter_unsupported, |
| 132 | ZSTD_error_frameParameter_windowTooLarge, |
| 133 | ZSTD_error_corruption_detected, |
| 134 | ZSTD_error_checksum_wrong, |
| 135 | ZSTD_error_literals_headerWrong, |
| 136 | ZSTD_error_dictionary_corrupted, |
| 137 | ZSTD_error_dictionary_wrong, |
| 138 | ZSTD_error_dictionaryCreation_failed, |
| 139 | ZSTD_error_parameter_unsupported, |
| 140 | ZSTD_error_parameter_combination_unsupported, |
| 141 | ZSTD_error_parameter_outOfBound, |
| 142 | ZSTD_error_tableLog_tooLarge, |
| 143 | ZSTD_error_maxSymbolValue_tooLarge, |
| 144 | ZSTD_error_maxSymbolValue_tooSmall, |
| 145 | ZSTD_error_stabilityCondition_notRespected, |
| 146 | ZSTD_error_stage_wrong, |
| 147 | ZSTD_error_init_missing, |
| 148 | ZSTD_error_memory_allocation, |
| 149 | ZSTD_error_workSpace_tooSmall, |
| 150 | ZSTD_error_dstSize_tooSmall, |
| 151 | ZSTD_error_srcSize_wrong, |
| 152 | ZSTD_error_dstBuffer_null, |
| 153 | ZSTD_error_noForwardProgress_destFull, |
| 154 | ZSTD_error_noForwardProgress_inputEmpty, |
| 155 | } = constants; |
| 156 | |
| 157 | function protectMethod(method: unknown): unknown { |
| 158 | if (!nodeJsZlib) { |
| 159 | return function notImplemented() { |
| 160 | throw new Error('Compatibility flag "nodejs_zlib" is not enabled'); |
| 161 | }; |
| 162 | } |
| 163 | |
| 164 | return method; |
| 165 | } |
| 166 | |
| 167 | const Gzip = protectMethod(zlib.Gzip); |
| 168 | const Gunzip = protectMethod(zlib.Gunzip); |
| 169 | const Deflate = protectMethod(zlib.Deflate); |
| 170 | const DeflateRaw = protectMethod(zlib.DeflateRaw); |
| 171 | const Inflate = protectMethod(zlib.Inflate); |
| 172 | const InflateRaw = protectMethod(zlib.InflateRaw); |
| 173 | const Unzip = protectMethod(zlib.Unzip); |
| 174 | const BrotliCompress = protectMethod(zlib.BrotliCompress); |
| 175 | const BrotliDecompress = protectMethod(zlib.BrotliDecompress); |
| 176 | const ZstdCompress = protectMethod(zlib.ZstdCompress); |
| 177 | const ZstdDecompress = protectMethod(zlib.ZstdDecompress); |
| 178 | |
| 179 | const createGzip = protectMethod(zlib.createGzip); |
| 180 | const createGunzip = protectMethod(zlib.createGunzip); |
| 181 | const createDeflate = protectMethod(zlib.createDeflate); |
| 182 | const createDeflateRaw = protectMethod(zlib.createDeflateRaw); |
| 183 | const createInflate = protectMethod(zlib.createInflate); |
| 184 | const createInflateRaw = protectMethod(zlib.createInflateRaw); |
| 185 | const createUnzip = protectMethod(zlib.createUnzip); |
| 186 | const createBrotliCompress = protectMethod(zlib.createBrotliCompress); |
| 187 | const createBrotliDecompress = protectMethod(zlib.createBrotliDecompress); |
| 188 | const createZstdCompress = protectMethod(zlib.createZstdCompress); |
| 189 | const createZstdDecompress = protectMethod(zlib.createZstdDecompress); |
| 190 | |
| 191 | const inflate = protectMethod(zlib.inflate); |
| 192 | const inflateSync = protectMethod(zlib.inflateSync); |
| 193 | const deflate = protectMethod(zlib.deflate); |
| 194 | const deflateSync = protectMethod(zlib.deflateSync); |
| 195 | const inflateRaw = protectMethod(zlib.inflateRaw); |
| 196 | const inflateRawSync = protectMethod(zlib.inflateRawSync); |
| 197 | const deflateRaw = protectMethod(zlib.deflateRaw); |
| 198 | const deflateRawSync = protectMethod(zlib.deflateRawSync); |
| 199 | const gzip = protectMethod(zlib.gzip); |
| 200 | const gzipSync = protectMethod(zlib.gzipSync); |
| 201 | const gunzip = protectMethod(zlib.gunzip); |
| 202 | const gunzipSync = protectMethod(zlib.gunzipSync); |
| 203 | const unzip = protectMethod(zlib.unzip); |
| 204 | const unzipSync = protectMethod(zlib.unzipSync); |
| 205 | const brotliCompress = protectMethod(zlib.brotliCompress); |
| 206 | const brotliCompressSync = protectMethod(zlib.brotliCompressSync); |
| 207 | const brotliDecompress = protectMethod(zlib.brotliDecompress); |
| 208 | const brotliDecompressSync = protectMethod(zlib.brotliDecompressSync); |
| 209 | const zstdCompress = protectMethod(zlib.zstdCompress); |
| 210 | const zstdCompressSync = protectMethod(zlib.zstdCompressSync); |
| 211 | const zstdDecompress = protectMethod(zlib.zstdDecompress); |
| 212 | const zstdDecompressSync = protectMethod(zlib.zstdDecompressSync); |
| 213 | |
| 214 | export { |
| 215 | crc32, |
| 216 | codes, |
| 217 | constants, |
| 218 | |
| 219 | // Classes |
| 220 | Gzip, |
| 221 | Gunzip, |
| 222 | Deflate, |
| 223 | DeflateRaw, |
| 224 | Inflate, |
| 225 | InflateRaw, |
| 226 | Unzip, |
| 227 | BrotliCompress, |
| 228 | BrotliDecompress, |
| 229 | ZstdCompress, |
| 230 | ZstdDecompress, |
| 231 | |
| 232 | // Convenience methods to create classes |
| 233 | createGzip, |
| 234 | createGunzip, |
| 235 | createDeflate, |
| 236 | createDeflateRaw, |
| 237 | createInflate, |
| 238 | createInflateRaw, |
| 239 | createUnzip, |
| 240 | createBrotliCompress, |
| 241 | createBrotliDecompress, |
| 242 | createZstdCompress, |
| 243 | createZstdDecompress, |
| 244 | |
| 245 | // One-shot methods |
| 246 | inflate, |
| 247 | inflateSync, |
| 248 | deflate, |
| 249 | deflateSync, |
| 250 | inflateRaw, |
| 251 | inflateRawSync, |
| 252 | deflateRaw, |
| 253 | deflateRawSync, |
| 254 | gzip, |
| 255 | gzipSync, |
| 256 | gunzip, |
| 257 | gunzipSync, |
| 258 | unzip, |
| 259 | unzipSync, |
| 260 | brotliDecompress, |
| 261 | brotliDecompressSync, |
| 262 | brotliCompress, |
| 263 | brotliCompressSync, |
| 264 | zstdCompress, |
| 265 | zstdCompressSync, |
| 266 | zstdDecompress, |
| 267 | zstdDecompressSync, |
| 268 | |
| 269 | // NodeJS also exports all constants directly under zlib, but this is deprecated |
| 270 | Z_NO_FLUSH, |
| 271 | Z_PARTIAL_FLUSH, |
| 272 | Z_SYNC_FLUSH, |
| 273 | Z_FULL_FLUSH, |
| 274 | Z_FINISH, |
| 275 | Z_BLOCK, |
| 276 | Z_OK, |
| 277 | Z_STREAM_END, |
| 278 | Z_NEED_DICT, |
| 279 | Z_ERRNO, |
| 280 | Z_STREAM_ERROR, |
| 281 | Z_DATA_ERROR, |
| 282 | Z_MEM_ERROR, |
| 283 | Z_BUF_ERROR, |
| 284 | Z_VERSION_ERROR, |
| 285 | Z_NO_COMPRESSION, |
| 286 | Z_BEST_SPEED, |
| 287 | Z_BEST_COMPRESSION, |
| 288 | Z_DEFAULT_COMPRESSION, |
| 289 | Z_FILTERED, |
| 290 | Z_HUFFMAN_ONLY, |
| 291 | Z_RLE, |
| 292 | Z_FIXED, |
| 293 | Z_DEFAULT_STRATEGY, |
| 294 | ZLIB_VERNUM, |
| 295 | DEFLATE, |
| 296 | INFLATE, |
| 297 | GZIP, |
| 298 | GUNZIP, |
| 299 | DEFLATERAW, |
| 300 | INFLATERAW, |
| 301 | UNZIP, |
| 302 | BROTLI_DECODE, |
| 303 | BROTLI_ENCODE, |
| 304 | ZSTD_ENCODE, |
| 305 | ZSTD_DECODE, |
| 306 | Z_MIN_WINDOWBITS, |
| 307 | Z_MAX_WINDOWBITS, |
| 308 | Z_DEFAULT_WINDOWBITS, |
| 309 | Z_MIN_CHUNK, |
| 310 | Z_MAX_CHUNK, |
| 311 | Z_DEFAULT_CHUNK, |
| 312 | Z_MIN_MEMLEVEL, |
| 313 | Z_MAX_MEMLEVEL, |
| 314 | Z_DEFAULT_MEMLEVEL, |
| 315 | Z_MIN_LEVEL, |
| 316 | Z_MAX_LEVEL, |
| 317 | Z_DEFAULT_LEVEL, |
| 318 | BROTLI_OPERATION_PROCESS, |
| 319 | BROTLI_OPERATION_FLUSH, |
| 320 | BROTLI_OPERATION_FINISH, |
| 321 | BROTLI_OPERATION_EMIT_METADATA, |
| 322 | BROTLI_PARAM_MODE, |
| 323 | BROTLI_MODE_GENERIC, |
| 324 | BROTLI_MODE_TEXT, |
| 325 | BROTLI_MODE_FONT, |
| 326 | BROTLI_DEFAULT_MODE, |
| 327 | BROTLI_PARAM_QUALITY, |
| 328 | BROTLI_MIN_QUALITY, |
| 329 | BROTLI_MAX_QUALITY, |
| 330 | BROTLI_DEFAULT_QUALITY, |
| 331 | BROTLI_PARAM_LGWIN, |
| 332 | BROTLI_MIN_WINDOW_BITS, |
| 333 | BROTLI_MAX_WINDOW_BITS, |
| 334 | BROTLI_LARGE_MAX_WINDOW_BITS, |
| 335 | BROTLI_DEFAULT_WINDOW, |
| 336 | BROTLI_PARAM_LGBLOCK, |
| 337 | BROTLI_MIN_INPUT_BLOCK_BITS, |
| 338 | BROTLI_MAX_INPUT_BLOCK_BITS, |
| 339 | BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING, |
| 340 | BROTLI_PARAM_LARGE_WINDOW, |
| 341 | BROTLI_PARAM_NPOSTFIX, |
| 342 | BROTLI_PARAM_NDIRECT, |
| 343 | BROTLI_DECODER_RESULT_ERROR, |
| 344 | BROTLI_DECODER_RESULT_SUCCESS, |
| 345 | BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT, |
| 346 | BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT, |
| 347 | BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION, |
| 348 | BROTLI_DECODER_PARAM_LARGE_WINDOW, |
| 349 | BROTLI_DECODER_NO_ERROR, |
| 350 | BROTLI_DECODER_SUCCESS, |
| 351 | BROTLI_DECODER_NEEDS_MORE_INPUT, |
| 352 | BROTLI_DECODER_NEEDS_MORE_OUTPUT, |
| 353 | BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE, |
| 354 | BROTLI_DECODER_ERROR_FORMAT_RESERVED, |
| 355 | BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE, |
| 356 | BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET, |
| 357 | BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME, |
| 358 | BROTLI_DECODER_ERROR_FORMAT_CL_SPACE, |
| 359 | BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE, |
| 360 | BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT, |
| 361 | BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1, |
| 362 | BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2, |
| 363 | BROTLI_DECODER_ERROR_FORMAT_TRANSFORM, |
| 364 | BROTLI_DECODER_ERROR_FORMAT_DICTIONARY, |
| 365 | BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS, |
| 366 | BROTLI_DECODER_ERROR_FORMAT_PADDING_1, |
| 367 | BROTLI_DECODER_ERROR_FORMAT_PADDING_2, |
| 368 | BROTLI_DECODER_ERROR_FORMAT_DISTANCE, |
| 369 | BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET, |
| 370 | BROTLI_DECODER_ERROR_INVALID_ARGUMENTS, |
| 371 | BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES, |
| 372 | BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS, |
| 373 | BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP, |
| 374 | BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1, |
| 375 | BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2, |
| 376 | BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES, |
| 377 | BROTLI_DECODER_ERROR_UNREACHABLE, |
| 378 | ZSTD_COMPRESS, |
| 379 | ZSTD_DECOMPRESS, |
| 380 | ZSTD_error_no_error, |
| 381 | ZSTD_error_GENERIC, |
| 382 | ZSTD_error_prefix_unknown, |
| 383 | ZSTD_error_version_unsupported, |
| 384 | ZSTD_error_frameParameter_unsupported, |
| 385 | ZSTD_error_frameParameter_windowTooLarge, |
| 386 | ZSTD_error_corruption_detected, |
| 387 | ZSTD_error_checksum_wrong, |
| 388 | ZSTD_error_literals_headerWrong, |
| 389 | ZSTD_error_dictionary_corrupted, |
| 390 | ZSTD_error_dictionary_wrong, |
| 391 | ZSTD_error_dictionaryCreation_failed, |
| 392 | ZSTD_error_parameter_unsupported, |
| 393 | ZSTD_error_parameter_combination_unsupported, |
| 394 | ZSTD_error_parameter_outOfBound, |
| 395 | ZSTD_error_tableLog_tooLarge, |
| 396 | ZSTD_error_maxSymbolValue_tooLarge, |
| 397 | ZSTD_error_maxSymbolValue_tooSmall, |
| 398 | ZSTD_error_stabilityCondition_notRespected, |
| 399 | ZSTD_error_stage_wrong, |
| 400 | ZSTD_error_init_missing, |
| 401 | ZSTD_error_memory_allocation, |
| 402 | ZSTD_error_workSpace_tooSmall, |
| 403 | ZSTD_error_dstSize_tooSmall, |
| 404 | ZSTD_error_srcSize_wrong, |
| 405 | ZSTD_error_dstBuffer_null, |
| 406 | ZSTD_error_noForwardProgress_destFull, |
| 407 | ZSTD_error_noForwardProgress_inputEmpty, |
| 408 | }; |
| 409 | |
| 410 | export default { |
| 411 | crc32, |
| 412 | codes, |
| 413 | constants, |
| 414 | // NodeJS also exports all constants directly under zlib, but this is deprecated |
| 415 | ...constants, |
| 416 | |
| 417 | // Classes |
| 418 | Gzip, |
| 419 | Gunzip, |
| 420 | Deflate, |
| 421 | DeflateRaw, |
| 422 | Inflate, |
| 423 | InflateRaw, |
| 424 | Unzip, |
| 425 | BrotliCompress, |
| 426 | BrotliDecompress, |
| 427 | ZstdCompress, |
| 428 | ZstdDecompress, |
| 429 | |
| 430 | // Convenience methods to create classes |
| 431 | createGzip, |
| 432 | createGunzip, |
| 433 | createDeflate, |
| 434 | createDeflateRaw, |
| 435 | createInflate, |
| 436 | createInflateRaw, |
| 437 | createUnzip, |
| 438 | createBrotliCompress, |
| 439 | createBrotliDecompress, |
| 440 | createZstdCompress, |
| 441 | createZstdDecompress, |
| 442 | |
| 443 | // One-shot methods |
| 444 | inflate, |
| 445 | inflateSync, |
| 446 | deflate, |
| 447 | deflateSync, |
| 448 | inflateRaw, |
| 449 | inflateRawSync, |
| 450 | deflateRaw, |
| 451 | deflateRawSync, |
| 452 | gzip, |
| 453 | gzipSync, |
| 454 | gunzip, |
| 455 | gunzipSync, |
| 456 | unzip, |
| 457 | unzipSync, |
| 458 | brotliDecompress, |
| 459 | brotliDecompressSync, |
| 460 | brotliCompress, |
| 461 | brotliCompressSync, |
| 462 | zstdCompress, |
| 463 | zstdCompressSync, |
| 464 | zstdDecompress, |
| 465 | zstdDecompressSync, |
| 466 | }; |