OutputTransformBuilder
Defined in: output-transform/builder.ts:24
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.
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:28
Parameters
Section titled “Parameters”readonly OutputTransformSpec[] = []
Returns
Section titled “Returns”OutputTransformBuilder<T>
Methods
Section titled “Methods”aggregate()
Section titled “aggregate()”aggregate(
path,options):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:63
Compute aggregate values over an array.
Parameters
Section titled “Parameters”string
Dot-path to the array
options
Section titled “options”operations: aggregate functions, into: placement path (” = sibling, ‘self’ = inline)
string
operations
Section titled “operations”readonly AggregateOp[]
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
apply()
Section titled “apply()”apply(
fn,description):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:242
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<unknown>
at(
path):ScopedOutputTransformBuilder
Defined in: output-transform/builder.ts:256
Scope subsequent transforms to a sub-path.
Use .* wildcard to apply transforms to each value in a record or each element in an array.
Parameters
Section titled “Parameters”string
Dot-path to scope into, supports .* wildcard
Returns
Section titled “Returns”derive()
Section titled “derive()”derive(
path,fn,description,options?):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:145
Compute a derived field from the output (opaque function).
Parameters
Section titled “Parameters”string
Where to place the computed value
(output) => unknown
Computation function receiving the full current output
description
Section titled “description”string
Human-readable label
options?
Section titled “options?”Optional schema type hint and declared dependencies
dependencies?
Section titled “dependencies?”readonly string[]
string
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
filter()
Section titled “filter()”filter(
path,predicate):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:129
Filter an array by a declarative predicate.
Parameters
Section titled “Parameters”string
Dot-path to the array
predicate
Section titled “predicate”Predicate to evaluate per item
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
groupBy()
Section titled “groupBy()”groupBy(
path,key,options?):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:43
Group an array at path by a key field.
Parameters
Section titled “Parameters”string
Dot-path to the array
string
Property name to group by
options?
Section titled “options?”format: ‘record’ (default) or ‘entries’, omitKey: remove key from items
format?
Section titled “format?”"entries" | "record"
omitKey?
Section titled “omitKey?”boolean
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
indexBy()
Section titled “indexBy()”indexBy(
path,key,options?):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:204
Convert an array to a record keyed by a unique property.
Parameters
Section titled “Parameters”string
Dot-path to the array
string
Property with unique values
options?
Section titled “options?”omitKey: remove key from items
omitKey?
Section titled “omitKey?”boolean
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
nest()
Section titled “nest()”nest(
target,fields):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:81
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
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
omit()
Section titled “omit()”omit(
fields):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:190
Remove specified fields.
Parameters
Section titled “Parameters”fields
Section titled “fields”readonly string[]
Fields to remove
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
pick()
Section titled “pick()”pick(
fields):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:178
Keep only specified fields.
Parameters
Section titled “Parameters”fields
Section titled “fields”readonly string[]
Fields to keep
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
pivot()
Section titled “pivot()”pivot(
path,options):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:223
Pivot rows into columns.
Parameters
Section titled “Parameters”string
Dot-path to the array
options
Section titled “options”rowKey, columnKey, value field names
columnKey
Section titled “columnKey”string
rowKey
Section titled “rowKey”string
string
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
rename()
Section titled “rename()”rename(
mappings):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:166
Rename output keys.
Parameters
Section titled “Parameters”mappings
Section titled “mappings”Record<string, string>
Old key → new key mappings
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
sort()
Section titled “sort()”sort(
path,by,direction?):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:110
Sort an array by one or more fields.
Parameters
Section titled “Parameters”string
Dot-path to the array
Field name or array of SortField specs
string | readonly SortField[]
direction?
Section titled “direction?”Sort direction (default: ‘asc’, only for string by)
"asc" | "desc"
Returns
Section titled “Returns”OutputTransformBuilder<unknown>
unnest()
Section titled “unnest()”unnest(
path,fields?):OutputTransformBuilder<unknown>
Defined in: output-transform/builder.ts:95
Flatten a nested object’s properties up to the parent.
Parameters
Section titled “Parameters”string
Nested object to flatten
fields?
Section titled “fields?”readonly string[]
Specific fields to move (default: all)
Returns
Section titled “Returns”OutputTransformBuilder<unknown>