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

Function negate

packages/db-ivm/src/operators/negate.ts:18–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 * Negates the multiplicities in the input stream
17 */
18export function negate<T>(): PipedOperator<T, T> {
19 return (stream: IStreamBuilder<T>): IStreamBuilder<T> => {
20 const output = new StreamBuilder<T>(
21 stream.graph,
22 new DifferenceStreamWriter<T>(),
23 )
24 const operator = new NegateOperator<T>(
25 stream.graph.getNextOperatorId(),
26 stream.connectReader(),
27 output.writer,
28 )
29 stream.graph.addOperator(operator)
30 return output
31 }
32}

Callers 1

negate.test.tsFile · 0.85

Calls 3

getNextOperatorIdMethod · 0.80
connectReaderMethod · 0.80
addOperatorMethod · 0.80

Tested by

no test coverage detected