buildInitialParams function presentation exported

Last updated: 2026-03-04T23:21:38.421Z

Metrics

LOC: 11 Complexity: 3 Params: 3

Signature

buildInitialParams( defs: readonly GeneratorParamDef[], existing: GeneratorParams, ): : GeneratorParams

Summary

Builds initial params from param defs, merging existing values.

Source Code

export function buildInitialParams(
  defs: readonly GeneratorParamDef[],
  existing: GeneratorParams,
): GeneratorParams {
  const result: Record<string, unknown> = {};
  for (const def of defs) {
    const k = def.key as string;
    result[k] = k in existing ? existing[k] : def.defaultValue;
  }
  return result as GeneratorParams;
}

No outgoing dependencies.

Impact (Incoming)

graph LR buildInitialParams["buildInitialParams"] GeneratorOption["GeneratorOption"] FormsTabViewCallbacks["FormsTabViewCallbacks"] handleGeneratorTypeChange["handleGeneratorTypeChange"] GeneratorOption -->|calls| buildInitialParams FormsTabViewCallbacks -->|calls| buildInitialParams handleGeneratorTypeChange -->|calls| buildInitialParams style buildInitialParams fill:#dbeafe,stroke:#2563eb,stroke-width:2px click buildInitialParams "b6ce5c6111d112b3.html" click GeneratorOption "46d00f7f04960150.html" click FormsTabViewCallbacks "413148ba3c727cc8.html" click handleGeneratorTypeChange "f74c8ee533cbc9ab.html"