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

Method toStringTokens

packages/graph/src/Steps.ts:7264–7295  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7262 }
7263
7264 public override toStringTokens(): StepStringToken[] {
7265 const tokens: StepStringToken[] = [{ kind: "start" }, { kind: "name", value: this.name }];
7266
7267 let exprStr: string;
7268 switch (this.config.expression.type) {
7269 case "literal":
7270 exprStr = JSON.stringify(this.config.expression.values);
7271 break;
7272 case "null":
7273 exprStr = "null";
7274 break;
7275 case "property":
7276 exprStr = `${this.config.expression.variable}.${this.config.expression.property}`;
7277 break;
7278 case "variable":
7279 exprStr = this.config.expression.variable;
7280 break;
7281 case "parameter":
7282 exprStr = `$${this.config.expression.name}`;
7283 break;
7284 case "function":
7285 exprStr = `${this.config.expression.name}(...)`;
7286 break;
7287 case "expression":
7288 exprStr = "(expression)";
7289 break;
7290 }
7291
7292 tokens.push({ kind: "value", value: `${exprStr} AS ${this.config.alias}` });
7293 tokens.push({ kind: "end" });
7294 return tokens;
7295 }
7296}
7297
7298// ============================================================================

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected