Skip to content

Commit

Permalink
ref: replace forEach() with for() {} as prep for async
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ ONeal committed Feb 3, 2023
1 parent 2d19b28 commit c19206d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/hdkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ var HDKey = ("object" === typeof module && exports) || {};

let entries = path.split("/");
let _hdkey = hdkey;
entries.forEach(function (c, i) {
for (let i = 0; i < entries.length; i += 1) {
let c = entries[i];
if (i === 0) {
assert(/^[mM]{1}/.test(c), 'Path must start with "m" or "M"');
return;
continue;
}

let hardened = c.length > 1 && c[c.length - 1] === "'";
Expand All @@ -154,7 +155,7 @@ var HDKey = ("object" === typeof module && exports) || {};
}

_hdkey = _hdkey.deriveChild(childIndex);
});
}

return _hdkey;
};
Expand Down

0 comments on commit c19206d

Please sign in to comment.