( config: StepConfig, colorizers: StepTokenColorizers = defaultTokenColorizers, )
| 305 | } |
| 306 | |
| 307 | function 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 | } |
| 324 | export interface StepConfig { |
| 325 | /** |
| 326 | * The labels to associate with the step. |
no test coverage detected