Skip to content

Commit

Permalink
zlib: make “bare” constants un-enumerable
Browse files Browse the repository at this point in the history
We prefer for users to use `zlib.constants.XXX` instead of `zlib.XXX`.
Having both enumerable means that inspecting the `zlib` module
shows both variants, making the output significantly longer and
redundant.

PR-URL: nodejs#24824
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
Anna Henningsen authored and refack committed Jan 10, 2019
1 parent 36a69cc commit 172ab88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,6 @@ const bkeys = Object.keys(constants);
for (var bk = 0; bk < bkeys.length; bk++) {
var bkey = bkeys[bk];
Object.defineProperty(module.exports, bkey, {
enumerable: true, value: constants[bkey], writable: false
enumerable: false, value: constants[bkey], writable: false
});
}

0 comments on commit 172ab88

Please sign in to comment.