Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbarth committed Jan 7, 2024
1 parent 8893c02 commit c9d7510
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ export function derToPem(
if (pemLabel == null) {
throw new Error("PEM label is required when DER is given.");
}
const pem = `-----BEGIN ${pemLabel}-----\n${base64Der.replace(/ /g, "")}\n-----END ${pemLabel}-----`;
const pem = `-----BEGIN ${pemLabel}-----\n${base64Der.replace(
/ /g,
"",
)}\n-----END ${pemLabel}-----`;

return normalizePem(pem);
}
Expand Down
3 changes: 1 addition & 2 deletions test/utils-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as xmldom from "@xmldom/xmldom";
import * as xpath from "xpath";
import * as isDomNode from "@xmldom/is-dom-node";


describe("Utils tests", function () {
describe("derToPem", function () {
it("will return a normalized PEM format when given an non-normalized PEM format", function () {
Expand Down Expand Up @@ -50,7 +49,7 @@ describe("Utils tests", function () {
fs.readFileSync("./test/static/keyinfo - pretty-printed.xml", "latin1"),
);
const cert = xpath.select1(".//*[local-name(.)='X509Certificate']", xml);
isDomNode.assertIsNodeLike(cert)
isDomNode.assertIsNodeLike(cert);

const normalizedPem = fs.readFileSync("./test/static/keyinfo.pem", "latin1");

Expand Down

0 comments on commit c9d7510

Please sign in to comment.