Skip to content

Commit 10f7169

Browse files
trivikrBridgeAR
authored andcommitted
zlib: use for...of
PR-URL: #31051 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 8491e1c commit 10f7169

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎lib/zlib.js‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ const codes = {
9191
Z_VERSION_ERROR: constants.Z_VERSION_ERROR
9292
};
9393

94-
constckeys=ObjectKeys(codes);
95-
for(letck=0;ck<ckeys.length;ck++){
96-
constckey=ckeys[ck];
94+
for(constckeyofObjectKeys(codes)){
9795
codes[codes[ckey]]=ckey;
9896
}
9997

@@ -911,9 +909,7 @@ ObjectDefineProperties(module.exports, {
911909

912910
// These should be considered deprecated
913911
// expose all the zlib constants
914-
constbkeys=ObjectKeys(constants);
915-
for(letbk=0;bk<bkeys.length;bk++){
916-
constbkey=bkeys[bk];
912+
for(constbkeyofObjectKeys(constants)){
917913
if(bkey.startsWith('BROTLI'))continue;
918914
ObjectDefineProperty(module.exports,bkey,{
919915
enumerable: false,value: constants[bkey],writable: false

0 commit comments

Comments
 (0)