mirror of
https://github.com/welpo/tabi.git
synced 2025-10-10 23:38:53 +02:00
🎨 refactor: format JS with Prettier (#240)
This commit is contained in:
parent
39fc4ece61
commit
b6a89e6370
12 changed files with 93 additions and 62 deletions
|
@ -11,16 +11,16 @@
|
|||
const byteString = atob(encodedString);
|
||||
|
||||
// Convert byteString to an array of char codes.
|
||||
const charCodes = [...byteString].map(char => char.charCodeAt(0));
|
||||
const charCodes = [...byteString].map((char) => char.charCodeAt(0));
|
||||
|
||||
// Use TypedArray.prototype.set() to copy the char codes into a Uint8Array.
|
||||
const bytes = new Uint8Array(charCodes.length);
|
||||
bytes.set(charCodes);
|
||||
|
||||
const decoder = new TextDecoder("utf-8");
|
||||
const decoder = new TextDecoder('utf-8');
|
||||
return decoder.decode(bytes);
|
||||
} catch (e) {
|
||||
console.error("Failed to decode Base64 string: ", e);
|
||||
console.error('Failed to decode Base64 string: ', e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue