Files
Aislo/resources/tester/helper_472_5b_slots.cjs
T
eomsangdonandClaude Opus 5.5 77be773c07 refactor(472-5 5-B 값 주인 하나): 횡단 상세 객체 = 상세 가게 하나 — 계산 묶음 페이지는 지문(노선 · 표본)만
- 상세 가게 칸 셋(B06_Section_Section_Canon.ts · 가벼운 자리): 저장 정본 상세(받을 때 · 세션 · 판 바뀜 · 되돌릴 때 · 갈아끼움 제외) · 초안 전 hold 상세(판 바뀌면 새 판) · 노선 초안 상세(= pipelineDetail)
- 페이지: canon.detail · held.detail · shown 사본 걷음 — 저장 기준 셈(savedEdits · storedPvi · crossNow)은 가게 칸을 읽음 · 초안 버림 = 가게 hold 상세로 정본 잡음
- 떠남(forgetSectionMemory) · invalidate 때 칸 셋 비움 · savedStations 는 sub2 관 · 구조물 줄로 셈 → 남김
- 시험: test_472_5b_detail_owner(옛 코드 빨강 3) · 묶음 헬퍼 넷(365 · 346_2 · 349_0j · 451_drop)이 종단도 흉내 정본을 가게 칸에도 채움
- 위키 design_page 값 · 규칙 · 층 줄

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:07:30 +09:00

37 lines
1.4 KiB
JavaScript

/* 472-5 5-B 헬퍼 — 상세 가게 칸 셋(`B06_Section_Section_Canon.ts`) 넣고 비움. 짝 = `test_472_5b_detail_owner.py`. */
const fs = require("fs");
const path = require("path");
const ROOT = path.join(__dirname, "..", "..");
const ts = require(path.join(ROOT, "config", "node_modules", "typescript"));
const file = path.join(ROOT, "B06_Section", "B06_Section_Section_Canon.ts");
const js = ts.transpileModule(fs.readFileSync(file, "utf8"), {
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
}).outputText;
const box = { exports: {} };
new Function("exports", "module", "require", js)(box.exports, box, () => ({
readState: () => null,
}));
const c = box.exports;
const [a, b, d] = [{ tag: "a" }, { tag: "b" }, { tag: "d" }];
c.keepSavedDetail("P", 1, a);
c.keepSavedDetail("P", 2, b);
c.keepHeldDetail("P", 1, b);
c.setDraftSectionDetail("P", d);
const tag = (x) => x?.tag ?? null;
const out = {
saved1: tag(c.savedSectionDetail("P", 1)),
held1: tag(c.heldSectionDetail("P", 1)),
draft: tag(c.draftDetailOf("P")),
};
c.forgetDetailSlots("P", 1);
out.after1 = [
tag(c.savedSectionDetail("P", 1)),
tag(c.heldSectionDetail("P", 1)),
tag(c.savedSectionDetail("P", 2)),
tag(c.draftDetailOf("P")),
];
c.forgetDetailSlots("P");
out.afterAll = [tag(c.savedSectionDetail("P", 2)), tag(c.draftDetailOf("P"))];
console.log(JSON.stringify(out));