Skip to main content

@terascope/data-mate / core/utils

core/utils

Functions

flattenStringArg()

flattenStringArg<K>(arg): ReadonlySet<K>

Type parameters

Type parameter
K extends string | number | symbol

Parameters

ParameterType
argFieldArg<K>[]

Returns

ReadonlySet<K>

Source

data-mate/src/core/utils.ts:31


freezeArray()

freezeArray<T>(input): T extends Readonly<infer U> ? Readonly<U> : Readonly<T>

Type parameters

Type parameter
T extends ArrLike

Parameters

ParameterType
inputT

Returns

T extends Readonly<infer U> ? Readonly<U> : Readonly<T>

Source

data-mate/src/core/utils.ts:88


freezeObject()

freezeObject<T>(input): T extends Readonly<infer U> ? Readonly<U> : Readonly<T>

Type parameters

Type parameter
T extends Record<string, any>

Parameters

ParameterType
inputT

Returns

T extends Readonly<infer U> ? Readonly<U> : Readonly<T>

Source

data-mate/src/core/utils.ts:80


getChildDataTypeConfig()

getChildDataTypeConfig(config, baseField, fieldType): DataTypeFields | undefined

This is used in the Vector and Builder classes to get the correctly scoped field configurations since we use dot notation for nested field configurations

Parameters

ParameterType
configDataTypeFields | ReadonlyDataTypeFields
baseFieldstring
fieldTypeFieldType

Returns

DataTypeFields | undefined

Source

data-mate/src/core/utils.ts:100


getFieldsFromArg()

getFieldsFromArg<K>(fields, arg): ReadonlySet<K>

Type parameters

Type parameter
K extends string | number | symbol

Parameters

ParameterType
fieldsreadonly K[]
argFieldArg<K>[]

Returns

ReadonlySet<K>

Source

data-mate/src/core/utils.ts:11


getPointerArray()

getPointerArray(size): TypedArray

Gets the correctly sized TypeArray depending on the length of items

Parameters

ParameterType
sizenumber

Returns

TypedArray

Source

data-mate/src/core/utils.ts:60


getTypedArrayClass()

getTypedArrayClass(size): TypedArrayConstructor

Gets the correctly sized TypeArray constructor depending on the size of values being stored

Parameters

ParameterType
sizenumber

Returns

TypedArrayConstructor

Source

data-mate/src/core/utils.ts:68