Updates and more
This commit is contained in:
@@ -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, []);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user