Code Cleanup™

This commit is contained in:
2024-02-11 11:16:23 +01:00
parent 4b27eb76fe
commit 9fd8ddb9bd
62 changed files with 663 additions and 519 deletions

View File

@@ -23,7 +23,7 @@ import type {ListPage, PageList} from "@type/page.ts";
export const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
export const nameRegex = new RegExp("(?!.*\/).+(?=\\.(md|json))");
export const nameRegex = new RegExp("(?!.*/).+(?=\\.(md|json))");
export function mapToMap(pages: PageList): Map<string, ListPage[]> {
const map = new Map();
@@ -82,9 +82,9 @@ export function brightness(color: string) {
return Color(color).isLight();
}
export function base64ToBytes(base64: string) {
export function base64ToBytes(base64: string): Uint8Array {
const binString = atob(base64);
// @ts-ignore
// @ts-expect-error Some Function Missing
return Uint8Array.from(binString, (m) => m.codePointAt(0));
}