- 헬퍼 동작 그대로(풀이 함수 본문은 옮겨 담음) · 제품 코드 안 고침 - 확인: 이 묶음 헬퍼를 쓰는 시험 218 개 전 218 통과 → 후 218 통과 (시험별 junit 대조 · 어긋남 0) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
/* PLAN 483(요구 280-4) 측점 목록 거울 헬퍼 — 진짜 `B05_Profile/logic/B05_Profile_Sections_Stations.ts`
|
|
* `buildStations` 를 트랜스파일해 Node 로 돌림. 입력 argv[2] JSON(사례 목록) · 표준출력 JSON.
|
|
* 짝 = `test_280_4_stations.py`. */
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
const { makeLoader } = require("./helper_ts_stub_loader.cjs");
|
|
const CATALOG = require("./helper_322_catalog_module.cjs");
|
|
|
|
const ROOT = path.join(__dirname, "..", "..");
|
|
const { loadTs } = makeLoader({
|
|
root: ROOT,
|
|
});
|
|
|
|
const logic = loadTs(path.join(ROOT, "B05_Profile", "logic", "B05_Profile_Sections_Stations.ts"));
|
|
const station = loadTs(path.join(ROOT, "common_util", "common_util_structure_station.ts"));
|
|
station.setPlusStations(() => []);
|
|
const cases = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
|
|
const out = cases.map((c) =>
|
|
logic
|
|
.buildStations(c.line, c.curves, [], [], {
|
|
types: [],
|
|
stationSnap: c.snap,
|
|
stationSnapStep: c.step,
|
|
})
|
|
.map((s) => ({ m: s.chainageM, kind: s.kind, key: s.key })),
|
|
);
|
|
process.stdout.write(JSON.stringify(out));
|