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

Method getPathKey

packages/graph/src/Steps.ts:7042–7061  ·  view source on GitHub ↗
(
    path: TraversalPath<any, any, any>,
    items: readonly WithItemConfig[],
  )

Source from the content-addressed store, hash-verified

7040 }
7041
7042 protected getPathKey(
7043 path: TraversalPath<any, any, any>,
7044 items: readonly WithItemConfig[],
7045 ): string {
7046 const parts: string[] = [];
7047 for (const item of items) {
7048 const pathNode = path.get(item.alias);
7049 if (pathNode) {
7050 const val = pathNode.value;
7051 if (val && typeof val === "object" && "id" in val) {
7052 parts.push(String(val.id));
7053 } else {
7054 parts.push(JSON.stringify(val));
7055 }
7056 } else {
7057 parts.push("undefined");
7058 }
7059 }
7060 return parts.join("|");
7061 }
7062
7063 public override clone(partial?: Partial<WithStepConfig>) {
7064 return new WithStep({

Callers 1

traverseMethod · 0.95

Calls 2

getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected