MCPcopy Index your code
hub / github.com/codemix/graph / createStepsFromJSON

Function createStepsFromJSON

packages/graph/src/Steps.ts:7489–7503  ·  view source on GitHub ↗
(input: readonly StepJSON[])

Source from the content-addressed store, hash-verified

7487export type StepJSON = [string, StepConfig, any[]?];
7488
7489export function createStepsFromJSON(input: readonly StepJSON[]): readonly Step<any>[] {
7490 return input.map(([name, config, steps]) => {
7491 const StepClass = KnownSteps[name as keyof typeof KnownSteps] as unknown as new (
7492 config: StepConfig,
7493 steps?: readonly Step<any>[],
7494 ) => Step<any>;
7495 if (StepClass === undefined) {
7496 throw new Error(`Unknown step: ${name}`);
7497 }
7498 if (Array.isArray(steps)) {
7499 return new StepClass(config, createStepsFromJSON(steps));
7500 }
7501 return new StepClass(config);
7502 });
7503}

Callers 2

handleAsyncQueryFunction · 0.85
Steps.test.tsFile · 0.85

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected