fix linter configuration & jest type dependency

This commit is contained in:
tiagosiebler
2023-02-17 13:51:40 +00:00
parent 7669c037c8
commit 8e54ecbaf5
34 changed files with 1600 additions and 1710 deletions

View File

@@ -3,6 +3,7 @@ export async function signMessage(
secret: string
): Promise<string> {
const encoder = new TextEncoder();
// eslint-disable-next-line no-undef
const key = await window.crypto.subtle.importKey(
'raw',
encoder.encode(secret),
@@ -11,6 +12,7 @@ export async function signMessage(
['sign']
);
// eslint-disable-next-line no-undef
const signature = await window.crypto.subtle.sign(
'HMAC',
key,
@@ -18,8 +20,10 @@ export async function signMessage(
);
return Array.prototype.map
.call(new Uint8Array(signature), (x: any) =>
('00' + x.toString(16)).slice(-2)
.call(
new Uint8Array(signature),
(x: { toString: (arg0: number) => string }) =>
('00' + x.toString(16)).slice(-2)
)
.join('');
}