resolveValueSource function exported

Last updated: 2026-03-05T10:53:28.865Z

Metrics

LOC: 9 Complexity: 2 Params: 3

Signature

resolveValueSource( source: FlowValueSource, generateFn: (fieldType: FieldType, params?: GeneratorParams) => string, ): : string

Summary

Resolve a FlowValueSource to a concrete string value. For fixed sources the original value is returned. For generator sources the external generate function is invoked.

Tags

#@param source - The value source definition#@param generateFn - Generator function (`generate` from `@/lib/generators`)

Source Code

export function resolveValueSource(
  source: FlowValueSource,
  generateFn: (fieldType: FieldType, params?: GeneratorParams) => string,
): string {
  if (source.type === "fixed") {
    return source.value;
  }
  return generateFn(source.fieldType, source.params);
}

No outgoing dependencies.

Impact (Incoming)

graph LR resolveValueSource["resolveValueSource"] OrchestratorCallbacks["OrchestratorCallbacks"] runLoop["runLoop"] OrchestratorCallbacks -->|uses| resolveValueSource runLoop -->|calls| resolveValueSource style resolveValueSource fill:#dbeafe,stroke:#2563eb,stroke-width:2px click resolveValueSource "038d75ba8fb4a8c2.html" click OrchestratorCallbacks "984a6b93df2ea9af.html" click runLoop "c94a70bb97b4ccad.html"
SourceType
OrchestratorCallbacks uses
runLoop calls