Files
Aislo/resources/tester/helper_322_3_plan.cjs
T
eomsangdonandClaude Opus 5.5 ae515ee778 feat(B05·B06 측점): 추가 측점 자료 · 심기 · [저장] · 좌표 따라감 (368-2)
- 측점 계획 짝 planStations(plus) ↔ plan_stations(plus=) — 주인 plus-{m} · 이름 "" · 같은 m 은 관 · 구조물이 이김
- 정본 B05_Profile/route/plus_stations.json(x · y) · GET/PUT /section/plus-stations · PUT 뒤 측점 맞춤
- 초안 plus-stations(설계 가게 plusStations) · [저장] 차례 구조물 뒤 · 계획고 앞
- 노선 저장 = 좌표로 따라감 · 되살림 대상 · B05 종단 · B06 목록 바뀜 신호
- 종단 세로선 plus 표시(점선 · 끌기 없음 자리)
- 거울 시험 272_1 · 322_3 · 344_3 에 추가 측점 경우 · 322_3 관 id 고정(347) 맞춤

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013QyNXY2TUKXCFMwAca2APG
2026-10-17 12:02:26 +09:00

44 lines
2.0 KiB
JavaScript

/* PLAN 322-3 측점 계획 한 벌 거울 헬퍼 — 진짜 `common_util_structure_station.ts`(planStations) ·
* `common_util_structure_catalog.ts` 를 그 자리에서 트랜스파일해 Node 로 돌림 · 결과 = 표준출력 JSON.
* 입력 = argv[2] JSON `{definition, types, cases: {이름: {pipes, structures, plus?}}}`(plus = 추가 측점 368-2). 짝 = `test_322_3_plan_mirror.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 cache = new Map();
function load(file) {
const full = path.resolve(file);
if (cache.has(full)) return cache.get(full);
if (full.endsWith(".json")) return JSON.parse(fs.readFileSync(full, "utf8"));
const js = ts.transpileModule(fs.readFileSync(full, "utf8"), {
compilerOptions: {
module: ts.ModuleKind.CommonJS,
target: ts.ScriptTarget.ES2020,
esModuleInterop: true,
},
}).outputText;
const box = { exports: {} };
cache.set(full, box.exports);
const need = (spec) => {
const base = path.join(path.dirname(full), spec);
const hit = [base, `${base}.ts`, base.replace(/\.js$/, ".ts")].find(
(p) => fs.existsSync(p) && fs.statSync(p).isFile(),
);
if (!hit) throw new Error(`모름: ${spec} (${full})`);
return load(hit);
};
new Function("exports", "module", "require", js)(box.exports, box, need);
return box.exports;
}
const input = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
const catalog = load(path.join(ROOT, "common_util", "common_util_structure_catalog.ts"));
const station = load(path.join(ROOT, "common_util", "common_util_structure_station.ts"));
catalog.useCatalogDefinition({ types: input.types, ...input.definition });
const out = {};
for (const [name, { pipes, structures, plus }] of Object.entries(input.cases))
out[name] = station.planStations(pipes, structures, input.types, undefined, plus ?? []);
process.stdout.write(JSON.stringify(out));