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

Method toStringTokens

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

Source from the content-addressed store, hash-verified

7074 }
7075
7076 public override toStringTokens(): StepStringToken[] {
7077 const tokens: StepStringToken[] = [{ kind: "start" }, { kind: "name", value: this.name }];
7078
7079 if (this.config.distinct) {
7080 tokens.push({ kind: "keyword", value: "DISTINCT" });
7081 }
7082
7083 const itemsStr = this.config.items
7084 .map((item) => {
7085 if (item.type === "aggregate") {
7086 return `${item.function}(${item.sourceVariable}${item.property ? "." + item.property : ""}) AS ${item.alias}`;
7087 } else if (item.type === "property") {
7088 return `${item.sourceVariable}.${item.property} AS ${item.alias}`;
7089 } else if (item.type === "functionCall") {
7090 return `${item.functionName}(...) AS ${item.alias}`;
7091 } else if (item.type === "expression") {
7092 return `(expr) AS ${item.alias}`;
7093 } else {
7094 return item.sourceVariable === item.alias
7095 ? item.alias
7096 : `${item.sourceVariable} AS ${item.alias}`;
7097 }
7098 })
7099 .join(", ");
7100 tokens.push({ kind: "value", value: itemsStr });
7101
7102 tokens.push({ kind: "end" });
7103 return tokens;
7104 }
7105}
7106
7107function resolveProjectedOrderValue(

Callers 6

stringifyStepsFunction · 0.45
toStringFunction · 0.45
toStringTokensFunction · 0.45
toStringTokensMethod · 0.45
toStringTokensMethod · 0.45
toStringTokensMethod · 0.45

Calls 2

pushMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected