refactor: 프론트엔드 리펙토링

This commit is contained in:
donghyeon-ka
2026-09-18 22:05:42 +09:00
parent 5cc41467ae
commit ec7f20e2ee
100 changed files with 6005 additions and 2867 deletions
@@ -0,0 +1,21 @@
export type LocalDraft = Readonly<{
draftId: string;
title: string;
body: string;
}>;
export function createLocalDraft(values: LocalDraft): LocalDraft {
const draftId = values.draftId.trim();
const title = values.title.trim();
if (!draftId || !title) {
throw new TypeError("Local draft requires draftId and title");
}
if (title.length > 160 || values.body.length > 100_000) {
throw new TypeError("Local draft exceeds bounded field limits");
}
return Object.freeze({
draftId,
title,
body: values.body,
});
}