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

Method map

packages/graph/src/Traversals.ts:1201–1208  ·  view source on GitHub ↗

* Map each vertex in the traversal to a new value. * @param mapper A function that maps the path to a new value.

(mapper: (path: TPath) => TValue)

Source from the content-addressed store, hash-verified

1199 * @param mapper A function that maps the path to a new value.
1200 */
1201 public map<const TValue>(mapper: (path: TPath) => TValue) {
1202 return new ValueTraversal<TSchema, TValue>(this.graph, [
1203 ...this.steps,
1204 new MapElementsStep<TPath>({
1205 mapper,
1206 }),
1207 ]);
1208 }
1209
1210 /**
1211 * Order the vertices in the traversal.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected