collectype

collectype v0.11.0


collectype / utils/pipe/pipeFunctions / parsePipeExpression

Function: parsePipeExpression()

parsePipeExpression(expression): ParsedPipeStep[]

Defined in: utils/pipe/pipeFunctions.ts:30

Parses a pipe expression string into an array of parsed steps. Each step represents a method call with its arguments.

Parameters

expression

string

The pipe expression string

Returns

ParsedPipeStep[]

Array of parsed steps (ParsedPipeStep[])

Example

parsePipeExpression('filter(x => x > 0) | map(x => x * 2)');
// [ { methodName: 'filter', args: ['x => x > 0'] }, { methodName: 'map', args: ['x => x * 2'] } ]