fix(client): fix lint issues in scripts (#8621)

This commit is contained in:
Andreas Nedbal 2022-05-07 07:19:15 +02:00 committed by GitHub
parent ad860905c6
commit a975a0971c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 75 additions and 85 deletions

View file

@ -1,11 +1,11 @@
export function byteify(data: string, encoding: 'ascii' | 'base64' | 'hex') {
export function byteify(string: string, encoding: 'ascii' | 'base64' | 'hex') {
switch (encoding) {
case 'ascii':
return Uint8Array.from(data, c => c.charCodeAt(0));
return Uint8Array.from(string, c => c.charCodeAt(0));
case 'base64':
return Uint8Array.from(
atob(
data
string
.replace(/-/g, '+')
.replace(/_/g, '/')
),
@ -13,7 +13,7 @@ export function byteify(data: string, encoding: 'ascii' | 'base64' | 'hex') {
);
case 'hex':
return new Uint8Array(
data
string
.match(/.{1,2}/g)
.map(byte => parseInt(byte, 16))
);