Skip to content

Commit

Permalink
policy: replace entries with keys
Browse files Browse the repository at this point in the history
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: #41482
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
VoltrexKeyva authored Jan 17, 2022
1 parent 6b9d2ae commit a1f827a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/policy/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a1f827a

Please sign in to comment.