Skip to content

Commit edc5500

Browse files
authored
Merge pull request #1 from jwongmongodb/new-const-binding
New const binding
2 parents 8b3f0a8 + 618bf89 commit edc5500

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/index.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ for (var bk = 0; bk < bkeys.length; bk++) {
4343

4444
// translation table for return codes.
4545
const codes = {
46-
Z_OK: binding.Z_OK,
47-
Z_STREAM_END: binding.Z_STREAM_END,
48-
Z_NEED_DICT: binding.Z_NEED_DICT,
49-
Z_ERRNO: binding.Z_ERRNO,
50-
Z_STREAM_ERROR: binding.Z_STREAM_ERROR,
51-
Z_DATA_ERROR: binding.Z_DATA_ERROR,
52-
Z_MEM_ERROR: binding.Z_MEM_ERROR,
53-
Z_BUF_ERROR: binding.Z_BUF_ERROR,
54-
Z_VERSION_ERROR: binding.Z_VERSION_ERROR
46+
Z_OK: binding.Z_OK,
47+
Z_STREAM_END: binding.Z_STREAM_END,
48+
Z_NEED_DICT: binding.Z_NEED_DICT,
49+
Z_ERRNO: binding.Z_ERRNO,
50+
Z_STREAM_ERROR: binding.Z_STREAM_ERROR,
51+
Z_DATA_ERROR: binding.Z_DATA_ERROR,
52+
Z_MEM_ERROR: binding.Z_MEM_ERROR,
53+
Z_BUF_ERROR: binding.Z_BUF_ERROR,
54+
Z_VERSION_ERROR: binding.Z_VERSION_ERROR
5555
};
5656

5757
const ckeys = Object.keys(codes);
@@ -64,6 +64,10 @@ Object.defineProperty(exports, 'codes', {
6464
enumerable: true, value: Object.freeze(codes), writable: false
6565
});
6666

67+
Object.defineProperty(exports, 'constants', {
68+
configurable: false, enumerable: true, value: binding
69+
});
70+
6771
exports.Deflate = Deflate;
6872
exports.Inflate = Inflate;
6973
exports.Gzip = Gzip;

0 commit comments

Comments
 (0)