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

Method map

packages/graph/src/Traversals.ts:1296–1303  ·  view source on GitHub ↗

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

(mapper: (value: TValue) => TNextValue)

Source from the content-addressed store, hash-verified

1294 * @param mapper A function that maps the current value to a new value.
1295 */
1296 public map<const TNextValue>(mapper: (value: TValue) => TNextValue) {
1297 return new ValueTraversal<TSchema, TNextValue>(this.graph, [
1298 ...this.steps,
1299 new MapElementsStep<TValue>({
1300 mapper,
1301 }),
1302 ]);
1303 }
1304
1305 /**
1306 * Filter the values in the traversal using a predicate.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected