zlib: make “bare” constants un-enumerable
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: https://github.com/nodejs/node/pull/24824 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
26b58eabc6
commit
4eee55d354
@ -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
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user