@terascope/data-mate / core/utils
core/utils
Functions
flattenStringArg()
flattenStringArg<
K
>(arg
):ReadonlySet
<K
>
Type parameters
Type parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
arg | FieldArg <K >[] |
Returns
ReadonlySet
<K
>
Source
data-mate/src/core/utils.ts:31
freezeArray()
freezeArray<
T
>(input
):T
extendsReadonly
<infer U> ?Readonly
<U
> :Readonly
<T
>
Type parameters
Type parameter |
---|
T extends ArrLike |
Parameters
Parameter | Type |
---|---|
input | T |
Returns
T
extends Readonly
<infer U> ? Readonly
<U
> : Readonly
<T
>
Source
data-mate/src/core/utils.ts:88
freezeObject()
freezeObject<
T
>(input
):T
extendsReadonly
<infer U> ?Readonly
<U
> :Readonly
<T
>
Type parameters
Type parameter |
---|
T extends Record <string , any > |
Parameters
Parameter | Type |
---|---|
input | T |
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
Parameter | Type |
---|---|
config | DataTypeFields | ReadonlyDataTypeFields |
baseField | string |
fieldType | FieldType |
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
Parameter | Type |
---|---|
fields | readonly K [] |
arg | FieldArg <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
Parameter | Type |
---|---|
size | number |
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
Parameter | Type |
---|---|
size | number |
Returns
TypedArrayConstructor