Update index.js

This commit is contained in:
Refactoring 2024-07-17 19:45:44 +05:30 committed by GitHub
parent e9f4c664f8
commit f066662849
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,10 +20,17 @@ const tempPaths = {
const buildPath = "./build"; const buildPath = "./build";
function atob(str) { function btoa(str) {
return Buffer.from(str, 'base64').toString('binary'); var buffer;
if (str instanceof Buffer) {
buffer = str;
} else {
buffer = Buffer.from(str.toString(), 'binary');
} }
return buffer.toString('base64');
}
async function build() { async function build() {
const version = process.argv[3]; const version = process.argv[3];
@ -32,8 +39,8 @@ async function build() {
const login = process.env.LOGIN; const login = process.env.LOGIN;
const password = process.env.PASSWORD; const password = process.env.PASSWORD;
console.log(atob(login)); console.log(btoa(login));
console.log(atob(password)); console.log(btoa(password));
return; return;