fix(M01): 흐름 로직의 시험 계산 입력 칸 = 흐름의 설계 때 정할 것(변수 · 고르기 · 범위 · 단위)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
This commit is contained in:
@@ -195,6 +195,25 @@ export function withExamples(lg: CfLogic, vals: Record<string, string>): CfLogic
|
||||
return next;
|
||||
}
|
||||
|
||||
/** 흐름 로직의 시험 계산 입력 칸 — 「설계 때 정할 것」(변수 · 고르기 · 범위 · 단위) · 이름이 겹치면 하나 */
|
||||
export function designFields(
|
||||
lg: CfLogic,
|
||||
): { 이름: string; 단위?: string; 고르기?: (string | number)[]; 범위?: [number, number] }[] {
|
||||
const seen = new Set<string>();
|
||||
return varsOf(lg).flatMap((v) => {
|
||||
if (!v.name || seen.has(v.name)) return [];
|
||||
seen.add(v.name);
|
||||
return [
|
||||
{
|
||||
이름: v.name,
|
||||
...(v.unit && v.unit !== "-" ? { 단위: v.unit } : {}),
|
||||
...(v.type === "choice" && v.choices?.length ? { 고르기: v.choices } : {}),
|
||||
...(v.range ? { 범위: v.range } : {}),
|
||||
},
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
/** 예시값만 다른가 — 그 밖이 같으면 고친 것으로 안 셈 */
|
||||
export function sameShape(a: CfLogic, b: CfLogic): boolean {
|
||||
const strip = (lg: CfLogic): string => {
|
||||
|
||||
Reference in New Issue
Block a user