Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zlib: use for...of #31051

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ const codes = {
Z_VERSION_ERROR: constants.Z_VERSION_ERROR
};

const ckeys = ObjectKeys(codes);
for (let ck = 0; ck < ckeys.length; ck++) {
const ckey = ckeys[ck];
for (const ckey of ObjectKeys(codes)) {
codes[codes[ckey]] = ckey;
}

Expand Down Expand Up @@ -911,9 +909,7 @@ ObjectDefineProperties(module.exports, {

// These should be considered deprecated
// expose all the zlib constants
const bkeys = ObjectKeys(constants);
for (let bk = 0; bk < bkeys.length; bk++) {
const bkey = bkeys[bk];
for (const bkey of ObjectKeys(constants)) {
if (bkey.startsWith('BROTLI')) continue;
ObjectDefineProperty(module.exports, bkey, {
enumerable: false, value: constants[bkey], writable: false
Expand Down