Updates and more

This commit is contained in:
2023-11-05 22:27:20 +01:00
parent e97e86f9ac
commit 7450ecdabb
48 changed files with 565 additions and 111 deletions

View File

@@ -1,6 +1,6 @@
import Color from "color";
import type {Team} from "./types/team.js";
import type {ListPage, PageList} from "./types/page.ts";
import type {Team} from "../types/team.js";
import type {ListPage, PageList} from "../types/page.ts";
export const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
@@ -9,7 +9,7 @@ export const nameRegex = new RegExp("(?!.*\/).+(?=\\.md)");
export function mapToMap(pages: PageList): Map<string, ListPage[]> {
const map = new Map();
for (const page of pages) {
let folder = page.path.substring(0, page.path.indexOf(nameRegex.exec(page.path)[0]));
let folder = page.path.substring(0, page.path.indexOf(nameRegex.exec(page.path)!![0]));
if (!map.has(folder)) {
map.set(folder, []);
}