MCPcopy Create free account
hub / github.com/codemix/graph / stringifyStepConfig

Function stringifyStepConfig

packages/graph/src/Steps.ts:307–323  ·  view source on GitHub ↗
(
  config: StepConfig,
  colorizers: StepTokenColorizers = defaultTokenColorizers,
)

Source from the content-addressed store, hash-verified

305}
306
307function stringifyStepConfig(
308 config: StepConfig,
309 colorizers: StepTokenColorizers = defaultTokenColorizers,
310): string {
311 const elements: string[] = [];
312 for (const [key, value] of Object.entries(config)) {
313 if (value === undefined) {
314 continue;
315 }
316 if (typeof value === "function") {
317 elements.push(`${colorizers.label(key)}: ${colorizers.value(value.toString())}`);
318 } else {
319 elements.push(`${colorizers.label(key)}: ${colorizers.value(JSON.stringify(value))}`);
320 }
321 }
322 return elements.join(colorizers.punctuation(", "));
323}
324export interface StepConfig {
325 /**
326 * The labels to associate with the step.

Callers 1

stringTokensToLinesFunction · 0.85

Calls 3

valueMethod · 0.80
toStringMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected