Skip to content

Commit

Permalink
Downgraded eslint-plugin-prettier to 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo-Ciber94 committed Oct 10, 2023
1 parent e6af453 commit 234418c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 175 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"eslint": "^8.49.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-prettier": "^4.2.1",
"fs-extra": "^11.1.1",
"glob": "^10.3.7",
"lerna": "^7.3.0",
Expand Down
14 changes: 13 additions & 1 deletion packages/animelist-auth/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export namespace Auth {
refresh_token: refreshToken,
});

const credentials = Buffer.from(`${MAL_CLIENT_ID}:${MAL_CLIENT_SECRET}`).toString("base64");
const credentials = convertToBase64(`${MAL_CLIENT_ID}:${MAL_CLIENT_SECRET}`);

const res = await fetch(url, {
method: "POST",
Expand Down Expand Up @@ -198,3 +198,15 @@ export namespace Auth {
return Number.isNaN(userId) ? null : userId;
}
}

function convertToBase64(s: string): string {
if (typeof Buffer !== "undefined") {
return Buffer.from(s).toString("base64");
}

if (typeof btoa !== "undefined") {
return btoa(s);
}

throw new Error("Unable to convert string to base64, 'Buffer' and 'btoa' are not supported");
}
180 changes: 7 additions & 173 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 234418c

Please sign in to comment.