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')Type Parameters
Section titled “Type Parameters”T = unknown
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new OutputTransformBuilder<
T>(specs):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:170
Parameters
Section titled “Parameters”readonly OutputTransformSpec[] = []
Returns
Section titled “Returns”OutputTransformBuilder<T>
Methods
Section titled “Methods”aggregate()
Section titled “aggregate()”aggregate<
P>(path,options):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:214
Compute aggregate values over an array.
Type Parameters
Section titled “Type Parameters”P
Parameters
Section titled “Parameters”Selector<T, P>
Selector callback to the array property
options
Section titled “options”AggregateOptions
operations and placement (sibling or inline)
Returns
Section titled “Returns”OutputTransformBuilder<T>
apply()
Section titled “apply()”apply(
fn,description):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:578
Apply an opaque function transform (Tier 2 fallback).
Parameters
Section titled “Parameters”(value) => unknown
Transform function
description
Section titled “description”string
Human-readable label
Returns
Section titled “Returns”OutputTransformBuilder<T>
at<
P>(path):ScopedOutputTransformBuilder<T,P>
Defined in: output-transform/builder.ts:599
Scope subsequent transforms to a sub-path.
Type Parameters
Section titled “Type Parameters”P
Parameters
Section titled “Parameters”Selector<T, P>
Selector callback to the sub-path to scope into
Returns
Section titled “Returns”ScopedOutputTransformBuilder<T, P>
A scoped builder for chaining transforms within the scope
derive()
Section titled “derive()”derive(
path,fn,description,options?):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:325
Compute a derived field from the output (opaque function).
Parameters
Section titled “Parameters”Selector<T, unknown>
Selector callback to the target property for the derived value
(output) => unknown
Computation function receiving the full current output
description
Section titled “description”string
Human-readable label
options?
Section titled “options?”DeriveOptions
Optional schema type hint and declared dependencies
Returns
Section titled “Returns”OutputTransformBuilder<T>
drop()
Section titled “drop()”drop(
paths):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:472
Remove keys at arbitrary dot-paths (deep removal).
Parameters
Section titled “Parameters”readonly string[]
Dot-path strings to remove
Returns
Section titled “Returns”OutputTransformBuilder<T>
filter()
Section titled “filter()”filter<
P>(path,predicate):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:302
Filter an array by a declarative predicate.
Type Parameters
Section titled “Type Parameters”P
Parameters
Section titled “Parameters”Selector<T, P>
Selector callback to the array property
predicate
Section titled “predicate”Predicate to evaluate per item
Returns
Section titled “Returns”OutputTransformBuilder<T>
groupBy()
Section titled “groupBy()”groupBy<
P>(path,key,options?):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:189
Group an array at path by a key field.
Type Parameters
Section titled “Type Parameters”P
Parameters
Section titled “Parameters”Selector<T, P>
Selector callback to the array property
string & keyof ItemOf<P>
Property name within each item to group by
options?
Section titled “options?”GroupByOptions
format, omitKey, $defName
Returns
Section titled “Returns”OutputTransformBuilder<T>
indexBy()
Section titled “indexBy()”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.
Type Parameters
Section titled “Type Parameters”P
Parameters
Section titled “Parameters”Selector<T, P>
Selector callback to the array property
string
Property with unique values
options?
Section titled “options?”IndexByOptions
omitKey, $defName
Returns
Section titled “Returns”OutputTransformBuilder<T>
joinBy()
Section titled “joinBy()”Call Signature
Section titled “Call Signature”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.
Type Parameters
Section titled “Type Parameters”S extends Record<string, { cardinality: "one" | "many"; key: string; path: string & keyof T; }>
Parameters
Section titled “Parameters”options
Section titled “options”JoinByBaseOptions & object
Returns
Section titled “Returns”OutputTransformBuilder<{ [P in string | number | symbol as P extends S[keyof S][“path”] ? never : P]: T[P] }>
Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”options
Section titled “options”JoinByBaseOptions & object
Returns
Section titled “Returns”OutputTransformBuilder<T>
lookup()
Section titled “lookup()”Call Signature
Section titled “Call Signature”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.
Type Parameters
Section titled “Type Parameters”F extends string
Parameters
Section titled “Parameters”Selector<T, unknown>
options
Section titled “options”LookupOneMany & object
Returns
Section titled “Returns”OutputTransformBuilder<{ [P in string | number | symbol as P extends F ? never : P]: T[P] }>
Call Signature
Section titled “Call Signature”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.
Type Parameters
Section titled “Type Parameters”F extends string
Parameters
Section titled “Parameters”Selector<T, unknown>
options
Section titled “options”LookupMerge & object
Returns
Section titled “Returns”OutputTransformBuilder<{ [P in string | number | symbol as P extends F ? never : P]: T[P] }>
Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”Selector<T, unknown>
options
Section titled “options”LookupOneMany & object
Returns
Section titled “Returns”OutputTransformBuilder<T>
Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”Selector<T, unknown>
options
Section titled “options”LookupMerge & object
Returns
Section titled “Returns”OutputTransformBuilder<T>
nest()
Section titled “nest()”nest(
target,fields,options?):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:237
Move flat properties into a nested sub-object.
Parameters
Section titled “Parameters”target
Section titled “target”string
New nested property name
fields
Section titled “fields”readonly string[]
Properties to move into the nested object
options?
Section titled “options?”NestOptions
$defName for schema derivation
Returns
Section titled “Returns”OutputTransformBuilder<T>
omit()
Section titled “omit()”omit(
fields):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:382
Remove specified fields.
Parameters
Section titled “Parameters”fields
Section titled “fields”readonly string[]
Fields to remove
Returns
Section titled “Returns”OutputTransformBuilder<T>
pick()
Section titled “pick()”pick(
fields):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:366
Keep only specified fields.
Parameters
Section titled “Parameters”fields
Section titled “fields”readonly string[]
Fields to keep
Returns
Section titled “Returns”OutputTransformBuilder<T>
pivot()
Section titled “pivot()”pivot<
P>(path,options):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:424
Pivot rows into columns.
Type Parameters
Section titled “Type Parameters”P
Parameters
Section titled “Parameters”Selector<T, P>
Selector callback to the array property
options
Section titled “options”PivotOptions
rowKey, columnKey, value field names
Returns
Section titled “Returns”OutputTransformBuilder<T>
rename()
Section titled “rename()”rename(
mappings):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:350
Rename output keys.
Parameters
Section titled “Parameters”mappings
Section titled “mappings”Record<string, string>
Old key to new key mappings
Returns
Section titled “Returns”OutputTransformBuilder<T>
sort()
Section titled “sort()”sort<
P>(path,by,direction?):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:279
Sort an array by one or more fields.
Type Parameters
Section titled “Type Parameters”P
Parameters
Section titled “Parameters”Selector<T, P>
Selector callback to the array property
Field name or array of SortField specs
string | readonly SortField[]
direction?
Section titled “direction?”Sort direction (default: ‘asc’, only used when by is a string)
"asc" | "desc"
Returns
Section titled “Returns”OutputTransformBuilder<T>
unnest()
Section titled “unnest()”unnest(
path,fields?):OutputTransformBuilder<T>
Defined in: output-transform/builder.ts:260
Flatten a nested object’s properties up to the parent.
Parameters
Section titled “Parameters”string
Property key of the nested object
fields?
Section titled “fields?”readonly string[]
Specific fields to move (default: all)
Returns
Section titled “Returns”OutputTransformBuilder<T>
unpivot()
Section titled “unpivot()”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.
Type Parameters
Section titled “Type Parameters”P
Parameters
Section titled “Parameters”Selector<T, P>
Selector callback to the array property
options
Section titled “options”UnpivotOptions
idColumns, valueColumns/valueColumnPattern, nameField, valueField
Returns
Section titled “Returns”OutputTransformBuilder<T>