1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 09:55:38 +02:00

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
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))
);