feat: implement basic web app

This commit is contained in:
Henry Li
2026-01-15 23:40:21 +08:00
parent c7d68c6d3f
commit cecc684de1
49 changed files with 4142 additions and 626 deletions

View File

@@ -0,0 +1,10 @@
import { parse } from "best-effort-json-parser";
export function tryParseJSON(json: string) {
try {
const object = parse(json);
return object;
} catch {
return undefined;
}
}

View File

@@ -0,0 +1,10 @@
export function extractTitleFromMarkdown(markdown: string) {
if (markdown.startsWith("# ")) {
let title = markdown.split("\n")[0]!.trim();
if (title.startsWith("# ")) {
title = title.slice(2).trim();
}
return title;
}
return undefined;
}

View File

@@ -0,0 +1 @@
export { v4 as uuid } from "uuid";