Skip to main content

@terascope/data-mate / builder/Builder

builder/Builder

Index

Classes

ClassDescription
BuilderSince Vectors are immutable, a Builder can be used to construct a Vector. When values are inserted they are coerced and validated.

Interfaces

InterfaceDescription
BuilderOptionsA list of Builder Options

Type Aliases

ValueFromFn()<T>

ValueFromFn<T>: (value) => T

Coerce a value so it can be stored in the builder

Type parameters

Type parameter
T

Parameters

ParameterType
valueunknown

Returns

T

Source

data-mate/src/builder/Builder.ts:201

Functions

copyVectorToBuilder()

copyVectorToBuilder<T, R>(vector, builder): Vector<R>

Copy the values from a Vector to a Builder

Type parameters

Type parameter
T
R

Parameters

ParameterType
vectorVector<T> | ListVector<T>
builderBuilder<R>

Returns

Vector<R>

Source

data-mate/src/builder/Builder.ts:226


isBuilder()

isBuilder<T>(input): input is Builder<T>

Returns true if the input is a Builder

Type parameters

Type parameter
T

Parameters

ParameterType
inputunknown

Returns

input is Builder<T>

Source

data-mate/src/builder/Builder.ts:194


transformVectorToBuilder()

transformVectorToBuilder<T, R>(vector, builder, transform): Vector<R>

Copy the values from a Vector to a Builder

Type parameters

Type parameter
T
R

Parameters

ParameterType
vectorVector<T> | ListVector<T>
builderBuilder<R>
transform(value, index) => Maybe<R> | readonly Maybe<R>[]

Returns

Vector<R>

Source

data-mate/src/builder/Builder.ts:239