zlib: make “bare” constants un-enumerable · nodejs/node@4eee55d (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Commit 4eee55d
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: #24824Reviewed-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
File tree
1 file changed
lines changed
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -786,6 +786,6 @@ const bkeys = Object.keys(constants); | ||
786 | 786 | for (var bk = 0; bk < bkeys.length; bk++) { |
787 | 787 | var bkey = bkeys[bk]; |
788 | 788 | Object.defineProperty(module.exports, bkey, { |
789 | -enumerable: true, value: constants[bkey], writable: false | |
789 | +enumerable: false, value: constants[bkey], writable: false | |
790 | 790 | }); |
791 | 791 | } |