forked from mirrored/github-readme-stats
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
147a5d9e2a | ||
|
|
2c970b29c1 | ||
|
|
5c25f9c429 |
@@ -9,7 +9,7 @@ import {
|
||||
kFormatter,
|
||||
measureText,
|
||||
} from "../common/utils.js";
|
||||
import { getStyles } from "../getStyles.js";
|
||||
import { getStyles } from "../common/getStyles.js";
|
||||
import { statCardLocales } from "../translations.js";
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
getCardColors,
|
||||
lowercaseTrim,
|
||||
} from "../common/utils.js";
|
||||
import { getStyles } from "../getStyles.js";
|
||||
import { getStyles } from "../common/getStyles.js";
|
||||
import { wakatimeCardLocales } from "../translations.js";
|
||||
|
||||
/** Import language colors.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { getAnimations } from "../getStyles.js";
|
||||
import { getAnimations } from "./getStyles.js";
|
||||
import { encodeHTML, flexLayout } from "./utils.js";
|
||||
|
||||
class Card {
|
||||
|
||||
@@ -45,7 +45,9 @@ const retryer = async (fetcher, variables, retries = 0) => {
|
||||
// prettier-ignore
|
||||
// also checking for bad credentials if any tokens gets invalidated
|
||||
const isBadCredential = err.response.data && err.response.data.message === "Bad credentials";
|
||||
const isAccountSuspended = err.response.data && err.response.data.message === "Sorry. Your account was suspended.";
|
||||
const isAccountSuspended =
|
||||
err.response.data &&
|
||||
err.response.data.message === "Sorry. Your account was suspended.";
|
||||
|
||||
if (isBadCredential || isAccountSuspended) {
|
||||
logger.log(`PAT_${retries + 1} Failed`);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-check
|
||||
import axios from "axios";
|
||||
import githubUsernameRegex from "github-username-regex";
|
||||
import { calculateRank } from "../calculateRank.js";
|
||||
import { calculateRank } from "../common/calculateRank.js";
|
||||
import { retryer } from "../common/retryer.js";
|
||||
import {
|
||||
CustomError,
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { jest } from "@jest/globals";
|
||||
import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import api from "../api/index.js";
|
||||
import { calculateRank } from "../src/calculateRank.js";
|
||||
import { calculateRank } from "../src/common/calculateRank.js";
|
||||
import { renderStatsCard } from "../src/cards/stats-card.js";
|
||||
import { CONSTANTS, renderError } from "../src/common/utils.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import "@testing-library/jest-dom";
|
||||
import { calculateRank } from "../src/calculateRank.js";
|
||||
import { calculateRank } from "../src/common/calculateRank.js";
|
||||
|
||||
describe("Test calculateRank", () => {
|
||||
it("should calculate rank correctly", () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import "@testing-library/jest-dom";
|
||||
import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import { calculateRank } from "../src/calculateRank.js";
|
||||
import { calculateRank } from "../src/common/calculateRank.js";
|
||||
import { fetchStats } from "../src/fetchers/stats-fetcher.js";
|
||||
|
||||
const data = {
|
||||
|
||||
Reference in New Issue
Block a user