Skip to content

OutputTransformBuilder

Defined in: output-transform/builder.ts:166

Fluent builder that records output transform specifications.

Each method returns a new builder with the additional spec appended. The builder is immutable — each call produces a new instance.

Path parameters accept callback selectors for type-safe property access:

.groupBy(o => o.transactions, 'account')

T = unknown

new OutputTransformBuilder<T>(specs): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:170

readonly OutputTransformSpec[] = []

OutputTransformBuilder<T>

aggregate<P>(path, options): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:214

Compute aggregate values over an array.

P

Selector<T, P>

Selector callback to the array property

AggregateOptions

operations and placement (sibling or inline)

OutputTransformBuilder<T>


apply(fn, description): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:578

Apply an opaque function transform (Tier 2 fallback).

(value) => unknown

Transform function

string

Human-readable label

OutputTransformBuilder<T>


at<P>(path): ScopedOutputTransformBuilder<T, P>

Defined in: output-transform/builder.ts:599

Scope subsequent transforms to a sub-path.

P

Selector<T, P>

Selector callback to the sub-path to scope into

ScopedOutputTransformBuilder<T, P>

A scoped builder for chaining transforms within the scope


derive(path, fn, description, options?): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:325

Compute a derived field from the output (opaque function).

Selector<T, unknown>

Selector callback to the target property for the derived value

(output) => unknown

Computation function receiving the full current output

string

Human-readable label

DeriveOptions

Optional schema type hint and declared dependencies

OutputTransformBuilder<T>


drop(paths): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:472

Remove keys at arbitrary dot-paths (deep removal).

readonly string[]

Dot-path strings to remove

OutputTransformBuilder<T>


filter<P>(path, predicate): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:302

Filter an array by a declarative predicate.

P

Selector<T, P>

Selector callback to the array property

OutputPredicate

Predicate to evaluate per item

OutputTransformBuilder<T>


groupBy<P>(path, key, options?): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:189

Group an array at path by a key field.

P

Selector<T, P>

Selector callback to the array property

string & keyof ItemOf<P>

Property name within each item to group by

GroupByOptions

format, omitKey, $defName

OutputTransformBuilder<T>


indexBy<P>(path, key, options?): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:400

Convert an array to a record keyed by a unique property.

P

Selector<T, P>

Selector callback to the array property

string

Property with unique values

IndexByOptions

omitKey, $defName

OutputTransformBuilder<T>


joinBy<S>(options): OutputTransformBuilder<{ [P in string | number | symbol as P extends S[keyof S][“path”] ? never : P]: T[P] }>

Defined in: output-transform/builder.ts:541

N-way join of multiple arrays into a unified array by shared key. When consumeSources: true, source array types are removed from the output.

S extends Record<string, { cardinality: "one" | "many"; key: string; path: string & keyof T; }>

JoinByBaseOptions & object

OutputTransformBuilder<{ [P in string | number | symbol as P extends S[keyof S][“path”] ? never : P]: T[P] }>

joinBy(options): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:549

N-way join of multiple arrays into a unified array by shared key. When consumeSources: true, source array types are removed from the output.

JoinByBaseOptions & object

OutputTransformBuilder<T>


lookup<F>(path, options): OutputTransformBuilder<{ [P in string | number | symbol as P extends F ? never : P]: T[P] }>

Defined in: output-transform/builder.ts:487

Enrich one array with matched records from another by key. When consumeSource: true, the source array type is removed from the output.

F extends string

Selector<T, unknown>

LookupOneMany & object

OutputTransformBuilder<{ [P in string | number | symbol as P extends F ? never : P]: T[P] }>

lookup<F>(path, options): OutputTransformBuilder<{ [P in string | number | symbol as P extends F ? never : P]: T[P] }>

Defined in: output-transform/builder.ts:491

Enrich one array with matched records from another by key. When consumeSource: true, the source array type is removed from the output.

F extends string

Selector<T, unknown>

LookupMerge & object

OutputTransformBuilder<{ [P in string | number | symbol as P extends F ? never : P]: T[P] }>

lookup(path, options): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:495

Enrich one array with matched records from another by key. When consumeSource: true, the source array type is removed from the output.

Selector<T, unknown>

LookupOneMany & object

OutputTransformBuilder<T>

lookup(path, options): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:499

Enrich one array with matched records from another by key. When consumeSource: true, the source array type is removed from the output.

Selector<T, unknown>

LookupMerge & object

OutputTransformBuilder<T>


nest(target, fields, options?): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:237

Move flat properties into a nested sub-object.

string

New nested property name

readonly string[]

Properties to move into the nested object

NestOptions

$defName for schema derivation

OutputTransformBuilder<T>


omit(fields): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:382

Remove specified fields.

readonly string[]

Fields to remove

OutputTransformBuilder<T>


pick(fields): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:366

Keep only specified fields.

readonly string[]

Fields to keep

OutputTransformBuilder<T>


pivot<P>(path, options): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:424

Pivot rows into columns.

P

Selector<T, P>

Selector callback to the array property

PivotOptions

rowKey, columnKey, value field names

OutputTransformBuilder<T>


rename(mappings): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:350

Rename output keys.

Record<string, string>

Old key to new key mappings

OutputTransformBuilder<T>


sort<P>(path, by, direction?): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:279

Sort an array by one or more fields.

P

Selector<T, P>

Selector callback to the array property

Field name or array of SortField specs

string | readonly SortField[]

Sort direction (default: ‘asc’, only used when by is a string)

"asc" | "desc"

OutputTransformBuilder<T>


unnest(path, fields?): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:260

Flatten a nested object’s properties up to the parent.

string

Property key of the nested object

readonly string[]

Specific fields to move (default: all)

OutputTransformBuilder<T>


unpivot<P>(path, options): OutputTransformBuilder<T>

Defined in: output-transform/builder.ts:448

Unpivot (normalize) wide-format data into long format. Converts columns into rows.

P

Selector<T, P>

Selector callback to the array property

UnpivotOptions

idColumns, valueColumns/valueColumnPattern, nameField, valueField

OutputTransformBuilder<T>