MCPcopy Create free account
hub / github.com/TanStack/db / map

Function map

packages/db-ivm/src/operators/map.ts:32–47  ·  view source on GitHub ↗
(f: (data: T) => O)

Source from the content-addressed store, hash-verified

30 * @param f - The function to apply to each element
31 */
32export function map<T, O>(f: (data: T) => O): PipedOperator<T, O> {
33 return (stream: IStreamBuilder<T>): IStreamBuilder<O> => {
34 const output = new StreamBuilder<O>(
35 stream.graph,
36 new DifferenceStreamWriter<O>(),
37 )
38 const operator = new MapOperator<T, O>(
39 stream.graph.getNextOperatorId(),
40 stream.connectReader(),
41 output.writer,
42 f,
43 )
44 stream.graph.addOperator(operator)
45 return output
46 }
47}

Callers 15

compileQueryFunction · 0.90
processFromClauseFunction · 0.90
processUnionAllFunction · 0.90
wrapInputWithAliasFunction · 0.90
processFromFunction · 0.90
processJoinFunction · 0.90
processJoinSourceFunction · 0.90
processJoinResultsFunction · 0.90
processSelectFunction · 0.90
processGroupByFunction · 0.90
orderByFunction · 0.85
orderByWithIndexFunction · 0.85

Calls 3

getNextOperatorIdMethod · 0.80
connectReaderMethod · 0.80
addOperatorMethod · 0.80

Tested by

no test coverage detected