diff --git a/src/utils.ts b/src/utils.ts index 359e494..6098286 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -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); } diff --git a/test/utils-tests.spec.ts b/test/utils-tests.spec.ts index 551282b..b5fe41a 100644 --- a/test/utils-tests.spec.ts +++ b/test/utils-tests.spec.ts @@ -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 () { @@ -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");