update backend to the new templates
This commit is contained in:
parent
4e30986cda
commit
05be2596ea
44 changed files with 156 additions and 111 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue