Run prettier

This commit is contained in:
dangered wolf 2024-08-03 23:20:52 -07:00
parent bdba409f92
commit 88943830db
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58
5 changed files with 71 additions and 75 deletions

View file

@ -1,62 +1,61 @@
import af from './af/resources.json';
import ar from './ar/resources.json';
import ca from './ca/resources.json';
import cs from './cs/resources.json';
import da from './da/resources.json';
import de from './de/resources.json';
import el from './el/resources.json';
import en from './en/resources.json';
import es from './es-ES/resources.json';
import fi from './fi/resources.json';
import fr from './fr/resources.json';
import he from './he/resources.json';
import hu from './hu/resources.json';
import it from './it/resources.json';
import ja from './ja/resources.json';
import ko from './ko/resources.json';
import nl from './nl/resources.json';
import no from './no/resources.json';
import pl from './pl/resources.json';
import pt from './pt-PT/resources.json';
import ro from './ro/resources.json';
import ru from './ru/resources.json';
import sr from './sr/resources.json';
import sv from './sv-SE/resources.json';
import tr from './tr/resources.json';
import uk from './uk/resources.json';
import vi from './vi/resources.json';
import zhCN from './zh-CN/resources.json';
import zhTW from './zh-TW/resources.json';
export default {
af: {translation: af},
ar: {translation: ar},
ca: {translation: ca},
cs: {translation: cs},
da: {translation: da},
de: {translation: de},
el: {translation: el},
en: {translation: en},
es: {translation: es},
fi: {translation: fi},
fr: {translation: fr},
he: {translation: he},
hu: {translation: hu},
it: {translation: it},
ja: {translation: ja},
ko: {translation: ko},
nl: {translation: nl},
no: {translation: no},
pl: {translation: pl},
pt: {translation: pt},
ro: {translation: ro},
ru: {translation: ru},
sr: {translation: sr},
sv: {translation: sv},
tr: {translation: tr},
uk: {translation: uk},
vi: {translation: vi},
'zh-CN': {translation: zhCN},
'zh-TW': {translation: zhTW}
};
import af from './af/resources.json';
import ar from './ar/resources.json';
import ca from './ca/resources.json';
import cs from './cs/resources.json';
import da from './da/resources.json';
import de from './de/resources.json';
import el from './el/resources.json';
import en from './en/resources.json';
import es from './es-ES/resources.json';
import fi from './fi/resources.json';
import fr from './fr/resources.json';
import he from './he/resources.json';
import hu from './hu/resources.json';
import it from './it/resources.json';
import ja from './ja/resources.json';
import ko from './ko/resources.json';
import nl from './nl/resources.json';
import no from './no/resources.json';
import pl from './pl/resources.json';
import pt from './pt-PT/resources.json';
import ro from './ro/resources.json';
import ru from './ru/resources.json';
import sr from './sr/resources.json';
import sv from './sv-SE/resources.json';
import tr from './tr/resources.json';
import uk from './uk/resources.json';
import vi from './vi/resources.json';
import zhCN from './zh-CN/resources.json';
import zhTW from './zh-TW/resources.json';
export default {
'af': { translation: af },
'ar': { translation: ar },
'ca': { translation: ca },
'cs': { translation: cs },
'da': { translation: da },
'de': { translation: de },
'el': { translation: el },
'en': { translation: en },
'es': { translation: es },
'fi': { translation: fi },
'fr': { translation: fr },
'he': { translation: he },
'hu': { translation: hu },
'it': { translation: it },
'ja': { translation: ja },
'ko': { translation: ko },
'nl': { translation: nl },
'no': { translation: no },
'pl': { translation: pl },
'pt': { translation: pt },
'ro': { translation: ro },
'ru': { translation: ru },
'sr': { translation: sr },
'sv': { translation: sv },
'tr': { translation: tr },
'uk': { translation: uk },
'vi': { translation: vi },
'zh-CN': { translation: zhCN },
'zh-TW': { translation: zhTW }
};

View file

@ -1,7 +1,7 @@
import { Context } from 'hono';
import { StatusCode } from 'hono/utils/http-status';
import i18next from 'i18next';
import icu from "i18next-icu";
import icu from 'i18next-icu';
import { Constants } from '../constants';
import { handleQuote } from '../helpers/quote';
import { formatNumber, sanitizeText, truncateWithEllipsis } from '../helpers/utils';
@ -390,8 +390,10 @@ export const handleStatus = async (
/* Finally, add the footer of the poll with # of votes and time left */
str += '\n'; /* TODO: Localize time left */
str += i18next
.t('pollVotes', { voteCount: formatNumber(poll.total_votes), timeLeft: poll.time_left_en })
str += i18next.t('pollVotes', {
voteCount: formatNumber(poll.total_votes),
timeLeft: poll.time_left_en
});
/* Check if the poll is ongoing and apply low TTL cache control.
Yes, checking if this is a string is a hacky way to do this, but

View file

@ -4,7 +4,7 @@ import { profileRequest } from '../twitter/routes/profile';
import { Strings } from '../../strings';
import { Constants } from '../../constants';
import { linkHitRequest } from './hit';
import { trimTrailingSlash } from 'hono/trailing-slash'
import { trimTrailingSlash } from 'hono/trailing-slash';
export const api = new Hono();
@ -21,7 +21,7 @@ api.use('*', async (c, next) => {
await next();
});
api.use(trimTrailingSlash())
api.use(trimTrailingSlash());
api.get('/2/hit', linkHitRequest);

View file

@ -31,7 +31,7 @@ export const getBaseRedirectUrl = (c: Context) => {
const twitterStatusRequest = async (c: Context) => await statusRequest(c);
const _profileRequest = async (c: Context) => await profileRequest(c);
twitter.use(trimTrailingSlash())
twitter.use(trimTrailingSlash());
twitter.get('/:endpoint{status(es)?}/:id', twitterStatusRequest);
twitter.get('/:endpoint{status(es)?}/:id/:language', twitterStatusRequest);
twitter.get('/:handle{[0-9a-zA-Z_]+}/:endpoint{status(es)?}/:id/:language', twitterStatusRequest);
@ -60,10 +60,7 @@ twitter.get(
'/:prefix{(dir|dl)}/:handle{[0-9a-zA-Z_]+}/:endpoint{status(es)?}/:id/:mediaType{(photos?|videos?)}/:mediaNumber{[1-4]}/:language',
twitterStatusRequest
);
twitter.get(
'/:handle/:endpoint{status(es)?}/:id/*',
twitterStatusRequest
);
twitter.get('/:handle/:endpoint{status(es)?}/:id/*', twitterStatusRequest);
twitter.get('/version', versionRoute);
twitter.get('/set_base_redirect', setRedirectRequest);

View file

@ -56,9 +56,7 @@ export const statusRequest = async (c: Context) => {
} else if (Constants.INSTANT_VIEW_DOMAINS.includes(url.hostname)) {
console.log('Forced instant view request');
flags.forceInstantView = true;
} else if (
experimentCheck(Experiment.IV_FORCE_THREAD_UNROLL, userAgent.includes('Telegram'))
) {
} else if (experimentCheck(Experiment.IV_FORCE_THREAD_UNROLL, userAgent.includes('Telegram'))) {
console.log('Forced unroll instant view');
flags.instantViewUnrollThreads = true;
} else if (Constants.GALLERY_DOMAINS.includes(url.hostname)) {