Skip to content

Commit

Permalink
Modify code from previous PR
Browse files Browse the repository at this point in the history
  • Loading branch information
johncrisostomo committed Feb 24, 2018
1 parent 0958698 commit c0eeafc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.js
Expand Up @@ -9,20 +9,18 @@ function isEmpty(object) {
}

function pemEncode(str, n) {
const ret = []
var ret = []

for (var i = 1; i <= str.length; i++) {
ret.push(str[i - 1])
const mod = i % n
var mod = i % n

if (mod === 0) {
ret.push('\n')
}
}

const returnString = `-----BEGIN CERTIFICATE-----
${ret.join('')}
-----END CERTIFICATE-----`
var returnString = `-----BEGIN CERTIFICATE-----\n${ret.join('')}\n-----END CERTIFICATE-----`

return returnString
}
Expand Down

0 comments on commit c0eeafc

Please sign in to comment.