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 <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Mohammed Keyvanzadeh authored and Danielle Adams committed 2022-02-26 15:33:03 -05:00
1 parent 9e7cfbbcd9
commit b8b8e0bce6
1 file changed
+3 -1
+3 -1
View File
@@ -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) {