1 | // Update with any zlib constants that are added or changed in the future.
|
---|
2 | // Node v6 didn't export this, so we just hard code the version and rely
|
---|
3 | // on all the other hard-coded values from zlib v4736. When node v6
|
---|
4 | // support drops, we can just export the realZlibConstants object.
|
---|
5 | const realZlibConstants = require('zlib').constants ||
|
---|
6 | /* istanbul ignore next */ { ZLIB_VERNUM: 4736 }
|
---|
7 |
|
---|
8 | module.exports = Object.freeze(Object.assign(Object.create(null), {
|
---|
9 | Z_NO_FLUSH: 0,
|
---|
10 | Z_PARTIAL_FLUSH: 1,
|
---|
11 | Z_SYNC_FLUSH: 2,
|
---|
12 | Z_FULL_FLUSH: 3,
|
---|
13 | Z_FINISH: 4,
|
---|
14 | Z_BLOCK: 5,
|
---|
15 | Z_OK: 0,
|
---|
16 | Z_STREAM_END: 1,
|
---|
17 | Z_NEED_DICT: 2,
|
---|
18 | Z_ERRNO: -1,
|
---|
19 | Z_STREAM_ERROR: -2,
|
---|
20 | Z_DATA_ERROR: -3,
|
---|
21 | Z_MEM_ERROR: -4,
|
---|
22 | Z_BUF_ERROR: -5,
|
---|
23 | Z_VERSION_ERROR: -6,
|
---|
24 | Z_NO_COMPRESSION: 0,
|
---|
25 | Z_BEST_SPEED: 1,
|
---|
26 | Z_BEST_COMPRESSION: 9,
|
---|
27 | Z_DEFAULT_COMPRESSION: -1,
|
---|
28 | Z_FILTERED: 1,
|
---|
29 | Z_HUFFMAN_ONLY: 2,
|
---|
30 | Z_RLE: 3,
|
---|
31 | Z_FIXED: 4,
|
---|
32 | Z_DEFAULT_STRATEGY: 0,
|
---|
33 | DEFLATE: 1,
|
---|
34 | INFLATE: 2,
|
---|
35 | GZIP: 3,
|
---|
36 | GUNZIP: 4,
|
---|
37 | DEFLATERAW: 5,
|
---|
38 | INFLATERAW: 6,
|
---|
39 | UNZIP: 7,
|
---|
40 | BROTLI_DECODE: 8,
|
---|
41 | BROTLI_ENCODE: 9,
|
---|
42 | Z_MIN_WINDOWBITS: 8,
|
---|
43 | Z_MAX_WINDOWBITS: 15,
|
---|
44 | Z_DEFAULT_WINDOWBITS: 15,
|
---|
45 | Z_MIN_CHUNK: 64,
|
---|
46 | Z_MAX_CHUNK: Infinity,
|
---|
47 | Z_DEFAULT_CHUNK: 16384,
|
---|
48 | Z_MIN_MEMLEVEL: 1,
|
---|
49 | Z_MAX_MEMLEVEL: 9,
|
---|
50 | Z_DEFAULT_MEMLEVEL: 8,
|
---|
51 | Z_MIN_LEVEL: -1,
|
---|
52 | Z_MAX_LEVEL: 9,
|
---|
53 | Z_DEFAULT_LEVEL: -1,
|
---|
54 | BROTLI_OPERATION_PROCESS: 0,
|
---|
55 | BROTLI_OPERATION_FLUSH: 1,
|
---|
56 | BROTLI_OPERATION_FINISH: 2,
|
---|
57 | BROTLI_OPERATION_EMIT_METADATA: 3,
|
---|
58 | BROTLI_MODE_GENERIC: 0,
|
---|
59 | BROTLI_MODE_TEXT: 1,
|
---|
60 | BROTLI_MODE_FONT: 2,
|
---|
61 | BROTLI_DEFAULT_MODE: 0,
|
---|
62 | BROTLI_MIN_QUALITY: 0,
|
---|
63 | BROTLI_MAX_QUALITY: 11,
|
---|
64 | BROTLI_DEFAULT_QUALITY: 11,
|
---|
65 | BROTLI_MIN_WINDOW_BITS: 10,
|
---|
66 | BROTLI_MAX_WINDOW_BITS: 24,
|
---|
67 | BROTLI_LARGE_MAX_WINDOW_BITS: 30,
|
---|
68 | BROTLI_DEFAULT_WINDOW: 22,
|
---|
69 | BROTLI_MIN_INPUT_BLOCK_BITS: 16,
|
---|
70 | BROTLI_MAX_INPUT_BLOCK_BITS: 24,
|
---|
71 | BROTLI_PARAM_MODE: 0,
|
---|
72 | BROTLI_PARAM_QUALITY: 1,
|
---|
73 | BROTLI_PARAM_LGWIN: 2,
|
---|
74 | BROTLI_PARAM_LGBLOCK: 3,
|
---|
75 | BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4,
|
---|
76 | BROTLI_PARAM_SIZE_HINT: 5,
|
---|
77 | BROTLI_PARAM_LARGE_WINDOW: 6,
|
---|
78 | BROTLI_PARAM_NPOSTFIX: 7,
|
---|
79 | BROTLI_PARAM_NDIRECT: 8,
|
---|
80 | BROTLI_DECODER_RESULT_ERROR: 0,
|
---|
81 | BROTLI_DECODER_RESULT_SUCCESS: 1,
|
---|
82 | BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2,
|
---|
83 | BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3,
|
---|
84 | BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0,
|
---|
85 | BROTLI_DECODER_PARAM_LARGE_WINDOW: 1,
|
---|
86 | BROTLI_DECODER_NO_ERROR: 0,
|
---|
87 | BROTLI_DECODER_SUCCESS: 1,
|
---|
88 | BROTLI_DECODER_NEEDS_MORE_INPUT: 2,
|
---|
89 | BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3,
|
---|
90 | BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1,
|
---|
91 | BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2,
|
---|
92 | BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3,
|
---|
93 | BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4,
|
---|
94 | BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5,
|
---|
95 | BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6,
|
---|
96 | BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7,
|
---|
97 | BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8,
|
---|
98 | BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9,
|
---|
99 | BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10,
|
---|
100 | BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11,
|
---|
101 | BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12,
|
---|
102 | BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13,
|
---|
103 | BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14,
|
---|
104 | BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15,
|
---|
105 | BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16,
|
---|
106 | BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19,
|
---|
107 | BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20,
|
---|
108 | BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21,
|
---|
109 | BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22,
|
---|
110 | BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25,
|
---|
111 | BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26,
|
---|
112 | BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27,
|
---|
113 | BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30,
|
---|
114 | BROTLI_DECODER_ERROR_UNREACHABLE: -31,
|
---|
115 | }, realZlibConstants))
|
---|