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 GitHub committed 2022-01-17 22:56:11 +00:00
1 parent 6b9d2aefdb
commit a1f827a859
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) {