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 and BethGriggs committed Jan 24, 2022
1 parent 5e3f751 commit e11451c
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 e11451c

Please sign in to comment.