-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #30961 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information
Showing
3 changed files
with
14 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,11 @@ const { | |
// C=US\nST=CA\nL=SF\nO=Joyent\nOU=Node.js\nCN=ca1\[email protected] | ||
function parseCertString(s) { | ||
const out = ObjectCreate(null); | ||
const parts = s.split('\n'); | ||
for (let i = 0, len = parts.length; i < len; i++) { | ||
const sepIndex = parts[i].indexOf('='); | ||
for (const part of s.split('\n')) { | ||
const sepIndex = part.indexOf('='); | ||
if (sepIndex > 0) { | ||
const key = parts[i].slice(0, sepIndex); | ||
const value = parts[i].slice(sepIndex + 1); | ||
const key = part.slice(0, sepIndex); | ||
const value = part.slice(sepIndex + 1); | ||
if (key in out) { | ||
if (!ArrayIsArray(out[key])) { | ||
out[key] = [out[key]]; | ||
|