From b8b8e0bce6dccb8e207e1dede266ca285ea0fb4a Mon Sep 17 00:00:00 2001 From: Mohammed Keyvanzadeh Date: Tue, 18 Jan 2022 02:26:11 +0330 Subject: [PATCH] policy: replace entries with keys Replaced the entries with keys since the values of the entries are not used, and changed loop style to avoid mangled `Symbol.iterator`s and to keep consistency. PR-URL: https://github.com/nodejs/node/pull/41482 Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell --- lib/internal/policy/manifest.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/policy/manifest.js b/lib/internal/policy/manifest.js index e278e787db9257..61ee55d3a45637 100644 --- a/lib/internal/policy/manifest.js +++ b/lib/internal/policy/manifest.js @@ -130,7 +130,9 @@ class DependencyMapperInstance { this.#patternDependencies = undefined; } else { const patterns = []; - for (const { 0: key } of ObjectEntries(dependencies)) { + const keys = ObjectKeys(dependencies); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; if (StringPrototypeEndsWith(key, '*')) { const target = RegExpPrototypeExec(/^([^*]*)\*([^*]*)$/); if (!target) {