mapValueToSource function exported
Last updated: 2026-03-05T10:53:28.865Z
Location
Metrics
LOC: 20
Complexity: 4
Params: 4
Signature
mapValueToSource(
recordedValue: string,
fieldType: FieldType | null | undefined,
params?: GeneratorParams,
): : FlowValueSource
Summary
Build a FlowValueSource for a fill step. When the field was classified with a FieldType the replay will call the generator each time (producing fresh data). Otherwise the original value is stored as a fixed literal.
Source Code
export function mapValueToSource(
recordedValue: string,
fieldType: FieldType | null | undefined,
params?: GeneratorParams,
): FlowValueSource {
if (!fieldType) {
return { type: "fixed", value: recordedValue };
}
const source: FlowValueSource = {
type: "generator",
fieldType,
};
if (params && Object.keys(params).length > 0) {
return { ...source, params };
}
return source;
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| FieldType | uses |
| GeneratorParams | uses |
| FlowValueSource | uses |
Impact (Incoming)
| Source | Type |
|---|---|
| isValidFieldType | uses |
| convertSteps | calls |