update dependencies, add shims for node-fetch v3

This commit is contained in:
Michael C
2021-09-20 01:43:19 -04:00
parent 803c3f2a29
commit 1dd534cce9
5 changed files with 126 additions and 126 deletions

View File

@@ -45,7 +45,7 @@ export async function getTotalStats(req: Request, res: Response): Promise<void>
function updateExtensionUsers() {
if (config.userCounterURL) {
fetch(`${config.userCounterURL}/api/v1/userCount`)
.then(res => res.json())
.then(res => res.json() as Record<string, any>)
.then(data => {
apiUsersCache = Math.max(apiUsersCache, data.userCount);
})
@@ -56,7 +56,7 @@ function updateExtensionUsers() {
const chromeExtensionUrl = "https://chrome.google.com/webstore/detail/sponsorblock-for-youtube/mnjggcdmjocbbbhaepdhchncahnbgone";
fetch(mozillaAddonsUrl)
.then(res => res.json())
.then(res => res.json() as Record<string, any>)
.then(data => {
firefoxUsersCache = data.average_daily_users;
fetch(chromeExtensionUrl)