auto: 2026-09-20 02:30 (ESD_LAPTOP)

This commit is contained in:
2026-09-20 02:30:13 +09:00
parent f3653fe333
commit 090eb7d975
9 changed files with 419 additions and 11 deletions
+10
View File
@@ -33,6 +33,16 @@ export function withCell(row: Row, path: string, value: unknown): Row {
return { ...row, [head]: { ...(row[head] as Row), [sub]: value } };
}
/** 줄 안 깊은 자리 읽기 · 넣은 새 줄(중간 묶음 없으면 만듦). */
export const deep = (row: Row, path: string[]): unknown =>
path.reduce<unknown>((o, k) => (o as Row | null | undefined)?.[k], row);
export function withDeep(row: Row, path: string[], value: unknown): Row {
const [head, ...rest] = path;
if (!rest.length) return { ...row, [head]: value };
return { ...row, [head]: withDeep((row[head] ?? {}) as Row, rest, value) };
}
export function show(v: unknown): string {
if (v === null || v === undefined) return "";
if (Array.isArray(v)) return v.map((x) => (x === null ? "" : String(x))).join(" ~ ");