refactor: lint

This commit is contained in:
liyasthomas
2021-05-18 14:57:29 +05:30
parent 7f248da0b3
commit cc27c552af
84 changed files with 1444 additions and 973 deletions

View File

@@ -3,16 +3,17 @@ export const decodeB64StringToArrayBuffer = (input) => {
const ab = new ArrayBuffer(bytes)
const uarray = new Uint8Array(ab)
const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
const keyStr =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
let chr1, chr2, chr3
let enc1, enc2, enc3, enc4
let j = 0
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "")
input = input.replace(/[^A-Za-z0-9+/=]/g, "")
for (let i = 0; i < bytes; i += 3) {
//get the 3 octets in 4 ASCII chars
// get the 3 octets in 4 ASCII chars
enc1 = keyStr.indexOf(input.charAt(j++))
enc2 = keyStr.indexOf(input.charAt(j++))
enc3 = keyStr.indexOf(input.charAt(j++))
@@ -23,8 +24,8 @@ export const decodeB64StringToArrayBuffer = (input) => {
chr3 = ((enc3 & 3) << 6) | enc4
uarray[i] = chr1
if (enc3 != 64) uarray[i + 1] = chr2
if (enc4 != 64) uarray[i + 2] = chr3
if (enc3 !== 64) uarray[i + 1] = chr2
if (enc4 !== 64) uarray[i + 2] = chr3
}
return ab