From b9a4fe2ad619f9d3c1b4c4ce2cecbd382f057245 Mon Sep 17 00:00:00 2001 From: microshine Date: Mon, 11 Jan 2021 13:01:50 +0300 Subject: [PATCH] style: Fix TS errors --- src/mechs/aes/key.ts | 2 ++ src/mechs/des/key.ts | 2 ++ src/mechs/hmac/key.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/mechs/aes/key.ts b/src/mechs/aes/key.ts index f0a1561..d0c075d 100644 --- a/src/mechs/aes/key.ts +++ b/src/mechs/aes/key.ts @@ -10,6 +10,8 @@ export class AesCryptoKey extends SymmetricKey { @JsonProp({name: "k", converter: JsonBase64UrlConverter}) public data!: Buffer; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore public get alg() { switch (this.algorithm.name.toUpperCase()) { case "AES-CBC": diff --git a/src/mechs/des/key.ts b/src/mechs/des/key.ts index 3eab50e..cd1fbfb 100644 --- a/src/mechs/des/key.ts +++ b/src/mechs/des/key.ts @@ -10,6 +10,8 @@ export class DesCryptoKey extends SymmetricKey { @JsonProp({name: "k", converter: JsonBase64UrlConverter}) public data!: Buffer; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore public get alg() { switch (this.algorithm.name.toUpperCase()) { case "DES-CBC": diff --git a/src/mechs/hmac/key.ts b/src/mechs/hmac/key.ts index fe4aace..c357bd8 100644 --- a/src/mechs/hmac/key.ts +++ b/src/mechs/hmac/key.ts @@ -9,6 +9,8 @@ export class HmacCryptoKey extends CryptoKey { public algorithm!: HmacKeyAlgorithm; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore protected get alg() { const hash = this.algorithm.hash.name.toUpperCase(); return `HS${hash.replace("SHA-", "")}`;