Skip to content

Commit c00d47e

Browse files
Hexagongithub-actions[bot]
authored andcommitted
[skip_ci] v3.2.3: Build artifacts for Deno
1 parent d4d96cb commit c00d47e

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

dist/main.cjs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,11 +1087,6 @@ class PublicKey {
10871087
return this._original_pem;
10881088
} else if (this.getKey()) {
10891089
let pemResult = abToPem("PUBLIC KEY",await webcrypto.subtle.exportKey("spki", this.getKey()));
1090-
1091-
// Add trailing \n if missing (Deno only)
1092-
if (pemResult[pemResult.length - 1] !== "\n") {
1093-
pemResult += "\n";
1094-
}
10951090

10961091
return pemResult;
10971092
} else {
@@ -1817,13 +1812,13 @@ function pemToBase64(pem) {
18171812
}
18181813

18191814
// Remove trailing \n
1820-
pem = pem.replace(/^\n/, "");
1815+
pem = pem.replace(/\n$/, "");
18211816

18221817
// Split on \n
18231818
let pemArr = pem.split("\n");
18241819

18251820
// remove first and last lines
1826-
pemArr = pemArr.slice(1, pemArr.length - 2);
1821+
pemArr = pemArr.slice(1, pemArr.length - 1);
18271822
return pemArr.join("");
18281823
}
18291824

dist/main.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40702,9 +40702,9 @@ function pemToBase64(pem) {
4070240702
if (!isPem(pem)) {
4070340703
throw new Error("expected PEM string as input");
4070440704
}
40705-
pem = pem.replace(/^\n/, "");
40705+
pem = pem.replace(/\n$/, "");
4070640706
let pemArr = pem.split("\n");
40707-
pemArr = pemArr.slice(1, pemArr.length - 2);
40707+
pemArr = pemArr.slice(1, pemArr.length - 1);
4070840708
return pemArr.join("");
4070940709
}
4071040710
const mod3 = {
@@ -41465,9 +41465,6 @@ class PublicKey {
4146541465
return this._original_pem;
4146641466
} else if (this.getKey()) {
4146741467
let pemResult = abToPem("PUBLIC KEY", await mod2.webcrypto.subtle.exportKey("spki", this.getKey()));
41468-
if (pemResult[pemResult.length - 1] !== "\n") {
41469-
pemResult += "\n";
41470-
}
4147141468
return pemResult;
4147241469
} else {
4147341470
throw new Error("No key information available");

0 commit comments

Comments
 (0)