update backend to the new templates

This commit is contained in:
Hazelnoot 2025-10-07 00:40:02 -04:00
parent 4e30986cda
commit 05be2596ea
44 changed files with 156 additions and 111 deletions

View file

@ -4,7 +4,7 @@
*/
function parseBigIntChunked(str: string, base: number, chunkSize: number, powerOfChunkSize: bigint): bigint {
const chunks = [];
const chunks: string[] = [];
while (str.length > 0) {
chunks.unshift(str.slice(-chunkSize));
str = str.slice(0, -chunkSize);

View file

@ -12,7 +12,7 @@ export function generateInviteCode(now: number): string {
chars: CHARS,
});
const uniqueId = [];
const uniqueId: string[] = [];
let n = Math.floor(now / 1000 / 60);
while (true) {
uniqueId.push(CHARS[n % CHARS.length]);

View file

@ -80,7 +80,7 @@ export function lessThan(xs: number[], ys: number[]): boolean {
* Returns the longest prefix of elements that satisfy the predicate
*/
export function takeWhile<T>(f: Predicate<T>, xs: T[]): T[] {
const ys = [];
const ys: T[] = [];
for (const x of xs) {
if (f(x)) {
ys.push(x);

View file

@ -9,7 +9,7 @@ import type { HttpRequestService } from '@/core/HttpRequestService.js';
type Field = { name: string, value: string };
export async function verifyFieldLinks(fields: Field[], profileUrls: string[], httpRequestService: HttpRequestService): Promise<string[]> {
const verified_links = [];
const verified_links: string[] = [];
for (const field_url of fields) {
try {
// getHtml validates the input URL, so we can safely pass in untrusted values