feat: make lint happy
This commit is contained in:
@@ -407,7 +407,7 @@ function parsePemToArray(pem: string): Uint8Array {
|
||||
}
|
||||
}
|
||||
if (innerPem.length === 0) {
|
||||
return null;
|
||||
return new Uint8Array(0);
|
||||
}
|
||||
return decodeBase64(innerPem.join(""));
|
||||
}
|
||||
@@ -427,7 +427,9 @@ async function digestFile(filename: string, algorithm: string): Promise<Uint8Arr
|
||||
return new Uint8Array(hashBuffer);
|
||||
}
|
||||
|
||||
function normalizeHashAlgorithm(algorithm: string): string {
|
||||
type DigestAlgorithm = "SHA-256" | "SHA-384" | "SHA-512";
|
||||
|
||||
function normalizeHashAlgorithm(algorithm: string): DigestAlgorithm {
|
||||
let hashAlgorithm;
|
||||
switch (algorithm.toLowerCase()) {
|
||||
case "sha256":
|
||||
@@ -445,7 +447,7 @@ function normalizeHashAlgorithm(algorithm: string): string {
|
||||
default:
|
||||
throw `Unknown algorithm: ${algorithm}`;
|
||||
}
|
||||
return hashAlgorithm;
|
||||
return hashAlgorithm as DigestAlgorithm;
|
||||
}
|
||||
|
||||
async function testSshSig() {
|
||||
|
||||
Reference in New Issue
Block a user