Skip to main content

@terascope/utils / index

index

Index

Namespaces

NamespaceDescription
Logger-

Classes

ClassDescription
Logger-

Interfaces

InterfaceDescription
AnyObjectA simple object with any values
EmptyObject-
ListOfRecursiveArraysOrValuesA simple definitions of array
ManyA simple definitions of array
RecursiveArrayA simple definitions of array

References

AdjustDateArgs

Re-exports AdjustDateArgs


BigLRUMap

Re-exports BigLRUMap


BigMap

Re-exports BigMap


BigSet

Re-exports BigSet


Collector

Re-exports Collector


DataArrayInput

Re-exports DataArrayInput


DataEncoding

Re-exports DataEncoding


DataEntity

Re-exports DataEntity


DataEntityMetadata

Re-exports DataEntityMetadata


DataEntityMetadataValue

Re-exports DataEntityMetadataValue


DataInput

Re-exports DataInput


ElasticsearchError

Re-exports ElasticsearchError


EncodingConfig

Re-exports EncodingConfig


EntityMetadataValue

Re-exports EntityMetadataValue


EventLoop

Re-exports EventLoop


FlexibleArray

Re-exports FlexibleArray


InNumberRangeArg

Re-exports InNumberRangeArg


LOWER_CASE_CHARS

Re-exports LOWER_CASE_CHARS


MAX_STRING_LENGTH_BEFORE_MD5

Re-exports MAX_STRING_LENGTH_BEFORE_MD5


NUM_CHARS

Re-exports NUM_CHARS


PRetryConfig

Re-exports PRetryConfig


PWhileOptions

Re-exports PWhileOptions


Queue

Re-exports Queue


RouteSenderAPI

Re-exports RouteSenderAPI


STATUS_CODES

Renames and re-exports default


StringEntropy

Re-exports StringEntropy


StringEntropyFN

Re-exports StringEntropyFN


TSError

Re-exports TSError


TSErrorConfig

Re-exports TSErrorConfig


TSErrorContext

Re-exports TSErrorContext


TYPE_ENTITY_METADATA_KEY

Re-exports TYPE_ENTITY_METADATA_KEY


TYPE_IS_DATAENTITY_KEY

Re-exports TYPE_IS_DATAENTITY_KEY


UPPER_CASE_CHARS

Re-exports UPPER_CASE_CHARS


WORD_CHARS

Re-exports WORD_CHARS


WORD_SEPARATOR_CHARS

Re-exports WORD_SEPARATOR_CHARS


_DataEntityMetadata

Re-exports _DataEntityMetadata


_DataEntityMetadataType

Re-exports _DataEntityMetadataType


__ENTITY_METADATA_KEY

Re-exports __ENTITY_METADATA_KEY


__IS_DATAENTITY_KEY

Re-exports __IS_DATAENTITY_KEY


addToDate

Re-exports addToDate


addToDateFP

Re-exports addToDateFP


and

Re-exports and


bigIntToJSON

Re-exports bigIntToJSON


castArray

Re-exports castArray


chunk

Re-exports chunk


chunkIter

Re-exports chunkIter


clone

Re-exports clone


cloneDeep

Re-exports cloneDeep


coerceToGeoBoundary

Re-exports coerceToGeoBoundary


coerceToGeoPoint

Re-exports coerceToGeoPoint


coerceToNumberType

Re-exports coerceToNumberType


coerceToType

Re-exports coerceToType


concat

Re-exports concat


configurable

Re-exports configurable


contains

Re-exports contains


containsFP

Re-exports containsFP


dataEncodings

Re-exports dataEncodings


debugLogger

Re-exports debugLogger


endsWith

Re-exports endsWith


endsWithFP

Re-exports endsWithFP


ensureBuffer

Re-exports ensureBuffer


enumerable

Re-exports enumerable


escapeString

Re-exports escapeString


extractMappedIPv4

Re-exports extractMappedIPv4


fastAssign

Re-exports fastAssign


fastCloneDeep

Re-exports fastCloneDeep


filterObject

Re-exports filterObject


firstToLower

Re-exports firstToLower


firstToUpper

Re-exports firstToUpper


flatten

Re-exports flatten


flattenDeep

Re-exports flattenDeep


formatDateValue

Re-exports formatDateValue


formatRegex

Re-exports formatRegex


geoContains

Re-exports geoContains


geoContainsFP

Re-exports geoContainsFP


geoDisjoint

Re-exports geoDisjoint


geoDisjointFP

Re-exports geoDisjointFP


geoHash

Re-exports geoHash


geoIntersects

Re-exports geoIntersects


geoIntersectsFP

Re-exports geoIntersectsFP


geoJSONTypes

Re-exports geoJSONTypes


geoPointWithinRange

Re-exports geoPointWithinRange


geoPointWithinRangeFP

Re-exports geoPointWithinRangeFP


geoPolyHasPoint

Re-exports geoPolyHasPoint


geoRelationFP

Re-exports geoRelationFP


geoWithin

Re-exports geoWithin


geoWithinFP

Re-exports geoWithinFP


getBackoffDelay

Re-exports getBackoffDelay


getCIDRBroadcast

Re-exports getCIDRBroadcast


getCIDRMax

Re-exports getCIDRMax


getCIDRMin

Re-exports getCIDRMin


getCIDRNetwork

Re-exports getCIDRNetwork


getDate

Re-exports getDate


getDurationFunc

Re-exports getDurationFunc


getErrorStatusCode

Re-exports getErrorStatusCode


getField

Re-exports getField


getFirst

Re-exports getFirst


getFirstChar

Re-exports getFirstChar


getFirstIPInCIDR

Re-exports getFirstIPInCIDR


getFirstKey

Re-exports getFirstKey


getFirstUsableIPInCIDR

Re-exports getFirstUsableIPInCIDR


getFirstValue

Re-exports getFirstValue


getFullErrorStack

Re-exports getFullErrorStack


getHashCodeFrom

Re-exports getHashCodeFrom


getHours

Re-exports getHours


getLast

Re-exports getLast


getLastIPInCIDR

Re-exports getLastIPInCIDR


getLastUsableIPInCIDR

Re-exports getLastUsableIPInCIDR


getMilliseconds

Re-exports getMilliseconds


getMinutes

Re-exports getMinutes


getMonth

Re-exports getMonth


getSeconds

Re-exports getSeconds


getTime

Re-exports getTime


getTimeBetween

Re-exports getTimeBetween


getTimeBetweenFP

Re-exports getTimeBetweenFP


getTimezoneOffset

Re-exports getTimezoneOffset


getTimezoneOffsetFP

Re-exports getTimezoneOffsetFP


getTypeOf

Re-exports getTypeOf


getUTCDate

Re-exports getUTCDate


getUTCHours

Re-exports getUTCHours


getUTCMinutes

Re-exports getUTCMinutes


getUTCMonth

Re-exports getUTCMonth


getUTCYear

Re-exports getUTCYear


getUnixTime

Re-exports getUnixTime


getValidDate

Re-exports getValidDate


getValidDateOrNumberOrThrow

Re-exports getValidDateOrNumberOrThrow


getValidDateOrThrow

Re-exports getValidDateOrThrow


getValidDateWithTimezone

Re-exports getValidDateWithTimezone


getValidDateWithTimezoneOrThrow

Re-exports getValidDateWithTimezoneOrThrow


getWordParts

Re-exports getWordParts


getYear

Re-exports getYear


hasOwn

Re-exports hasOwn


inGeoBoundingBox

Re-exports inGeoBoundingBox


inGeoBoundingBoxFP

Re-exports inGeoBoundingBoxFP


inIPRange

Re-exports inIPRange


inNumberRange

Re-exports inNumberRange


inNumberRangeFP

Re-exports inNumberRangeFP


includes

Re-exports includes


intToIP

Re-exports intToIP


ipToInt

Re-exports ipToInt


isAfter

Re-exports isAfter


isAlpha

Re-exports isAlpha


isAlphaNumeric

Re-exports isAlphaNumeric


isArray

Re-exports isArray


isArrayLike

Re-exports isArrayLike


isAsyncIterator

Re-exports isAsyncIterator


isBase64

Re-exports isBase64


isBefore

Re-exports isBefore


isBetween

Re-exports isBetween


isBigInt

Re-exports isBigInt


isBoolean

Re-exports isBoolean


isBooleanLike

Re-exports isBooleanLike


isBuffer

Re-exports isBuffer


isCI

Re-exports isCI


isCIDR

Re-exports isCIDR


isCountryCode

Re-exports isCountryCode


isDateTuple

Re-exports isDateTuple


isDeepEqual

Re-exports isDeepEqual


isDeepEqualFP

Re-exports isDeepEqualFP


isDev

Re-exports isDev


isElasticsearchError

Re-exports isElasticsearchError


isEmail

Re-exports isEmail


isEmpty

Re-exports isEmpty


isEqual

Re-exports isEqual


isEqualFP

Re-exports isEqualFP


isError

Re-exports isError


isExecutedFile

Re-exports isExecutedFile


isFQDN

Re-exports isFQDN


isFalsy

Re-exports isFalsy


isFatalError

Re-exports isFatalError


isFloat

Re-exports isFloat


isFriday

Re-exports isFriday


isFunction

Re-exports isFunction


isFuture

Re-exports isFuture


isGeoJSON

Re-exports isGeoJSON


isGeoPoint

Re-exports isGeoPoint


isGeoShapeMultiPolygon

Re-exports isGeoShapeMultiPolygon


isGeoShapePoint

Re-exports isGeoShapePoint


isGeoShapePolygon

Re-exports isGeoShapePolygon


isGreaterThan

Re-exports isGreaterThan


isGreaterThanFP

Re-exports isGreaterThanFP


isGreaterThanOrEqualTo

Re-exports isGreaterThanOrEqualTo


isGreaterThanOrEqualToFP

Re-exports isGreaterThanOrEqualToFP


isIP

Re-exports isIP


isIPOrThrow

Re-exports isIPOrThrow


isIPRangeOrThrow

Re-exports isIPRangeOrThrow


isIPv4

Re-exports isIPv4


isIPv6

Re-exports isIPv6


isISDN

Re-exports isISDN


isISO8601

Re-exports isISO8601


isInteger

Re-exports isInteger


isIterator

Re-exports isIterator


isKey

Re-exports isKey


isLeapYear

Re-exports isLeapYear


isLessThan

Re-exports isLessThan


isLessThanFP

Re-exports isLessThanFP


isLessThanOrEqualTo

Re-exports isLessThanOrEqualTo


isLessThanOrEqualToFP

Re-exports isLessThanOrEqualToFP


isMACAddress

Re-exports isMACAddress


isMACAddressFP

Re-exports isMACAddressFP


isMIMEType

Re-exports isMIMEType


isMappedIPv4

Re-exports isMappedIPv4


isMonday

Re-exports isMonday


isNil

Re-exports isNil


isNonRoutableIP

Re-exports isNonRoutableIP


isNonZeroCidr

Re-exports isNonZeroCidr


isNotNil

Re-exports isNotNil


isNumber

Re-exports isNumber


isNumberLike

Re-exports isNumberLike


isObjectEntity

Re-exports isObjectEntity


isPast

Re-exports isPast


isPhoneNumberLike

Re-exports isPhoneNumberLike


isPlainObject

Re-exports isPlainObject


isPort

Re-exports isPort


isPostalCode

Re-exports isPostalCode


isPrimitiveValue

Re-exports isPrimitiveValue


isProd

Re-exports isProd


isRegExp

Re-exports isRegExp


isRegExpLike

Re-exports isRegExpLike


isRetryableError

Re-exports isRetryableError


isRoutableIP

Re-exports isRoutableIP


isSame

Re-exports isSame


isSaturday

Re-exports isSaturday


isSimpleObject

Re-exports isSimpleObject


isString

Re-exports isString


isSunday

Re-exports isSunday


isTSError

Re-exports isTSError


isTest

Re-exports isTest


isThursday

Re-exports isThursday


isToday

Re-exports isToday


isTomorrow

Re-exports isTomorrow


isTruthy

Re-exports isTruthy


isTuesday

Re-exports isTuesday


isTypedArray

Re-exports isTypedArray


isURL

Re-exports isURL


isUUID

Re-exports isUUID


isUnixTime

Re-exports isUnixTime


isUnixTimeFP

Re-exports isUnixTimeFP


isValidDate

Re-exports isValidDate


isValidDateInstance

Re-exports isValidDateInstance


isValidateNumberType

Re-exports isValidateNumberType


isWednesday

Re-exports isWednesday


isWeekday

Re-exports isWeekday


isWeekend

Re-exports isWeekend


isWildCardString

Re-exports isWildCardString


isYesterday

Re-exports isYesterday


joinList

Re-exports joinList


locked

Re-exports locked


logError

Re-exports logError


logLevels

Re-exports logLevels


lookup

Re-exports lookup


lookupTimezone

Re-exports lookupTimezone


makeCoordinatesFromGeoPoint

Re-exports makeCoordinatesFromGeoPoint


makeGeoBBox

Re-exports makeGeoBBox


makeGeoCircle

Re-exports makeGeoCircle


makeGeoFeature

Re-exports makeGeoFeature


makeGeoFeatureOrThrow

Re-exports makeGeoFeatureOrThrow


makeISODate

Re-exports makeISODate


mapKeys

Re-exports mapKeys


mapValues

Re-exports mapValues


match

Re-exports match


matchAll

Re-exports matchAll


matchAllFP

Re-exports matchAllFP


matchFP

Re-exports matchFP


matchWildcard

Re-exports matchWildcard


md5

Re-exports md5


memoize

Re-exports memoize


noop

Re-exports noop


not

Re-exports not


once

Re-exports once


or

Re-exports or


pDefer

Re-exports pDefer


pDelay

Re-exports pDelay


pImmediate

Re-exports pImmediate


pRace

Re-exports pRace


pRaceWithTimeout

Re-exports pRaceWithTimeout


pRetry

Re-exports pRetry


pWhile

Re-exports pWhile


parseCustomDateFormat

Re-exports parseCustomDateFormat


parseDateValue

Re-exports parseDateValue


parseError

Re-exports parseError


parseErrorInfo

Re-exports parseErrorInfo


parseGeoDistance

Re-exports parseGeoDistance


parseGeoDistanceUnit

Re-exports parseGeoDistanceUnit


parseGeoPoint

Re-exports parseGeoPoint


parseJSON

Re-exports parseJSON


parseList

Re-exports parseList


parseNumberList

Re-exports parseNumberList


parsePhoneNumber

Re-exports parsePhoneNumber


polyHasHoles

Re-exports polyHasHoles


prefixErrorMsg

Re-exports prefixErrorMsg


primitiveToString

Re-exports primitiveToString


random

Re-exports random


reverseIP

Re-exports reverseIP


setDate

Re-exports setDate


setHours

Re-exports setHours


setMilliseconds

Re-exports setMilliseconds


setMinutes

Re-exports setMinutes


setMonth

Re-exports setMonth


setPrecision

Re-exports setPrecision


setPrecisionFP

Re-exports setPrecisionFP


setSeconds

Re-exports setSeconds


setTimezone

Re-exports setTimezone


setTimezoneFP

Re-exports setTimezoneFP


setYear

Re-exports setYear


shannonEntropy

Re-exports shannonEntropy


shortenIPv6Address

Re-exports shortenIPv6Address


sort

Re-exports sort


sortBy

Re-exports sortBy


sortKeys

Re-exports sortKeys


startsWith

Re-exports startsWith


startsWithFP

Re-exports startsWithFP


stringEntropy

Re-exports stringEntropy


stripErrorMessage

Re-exports stripErrorMessage


subtractFromDate

Re-exports subtractFromDate


subtractFromDateFP

Re-exports subtractFromDateFP


times

Re-exports times


timesIter

Re-exports timesIter


timezoneOffset

Re-exports timezoneOffset


timezoneToOffset

Re-exports timezoneToOffset


toBigInt

Re-exports toBigInt


toBigIntOrThrow

Re-exports toBigIntOrThrow


toBoolean

Re-exports toBoolean


toBooleanOrThrow

Re-exports toBooleanOrThrow


toCIDR

Re-exports toCIDR


toCamelCase

Re-exports toCamelCase


toCelsius

Re-exports toCelsius


toEpochMSOrThrow

Re-exports toEpochMSOrThrow


toFahrenheit

Re-exports toFahrenheit


toFloat

Re-exports toFloat


toFloatOrThrow

Re-exports toFloatOrThrow


toGeoJSON

Re-exports toGeoJSON


toGeoJSONOrThrow

Re-exports toGeoJSONOrThrow


toHumanTime

Re-exports toHumanTime


toISO8601

Re-exports toISO8601


toInteger

Re-exports toInteger


toIntegerOrThrow

Re-exports toIntegerOrThrow


toJSONCompatibleValue

Re-exports toJSONCompatibleValue


toKebabCase

Re-exports toKebabCase


toLowerCase

Re-exports toLowerCase


toNumber

Re-exports toNumber


toNumberOrThrow

Re-exports toNumberOrThrow


toPascalCase

Re-exports toPascalCase


toSafeString

Re-exports toSafeString


toSnakeCase

Re-exports toSnakeCase


toStatusErrorCode

Re-exports toStatusErrorCode


toString

Re-exports toString


toTimeZone

Re-exports toTimeZone


toTimeZoneUsingLocation

Re-exports toTimeZoneUsingLocation


toTimeZoneUsingLocationFP

Re-exports toTimeZoneUsingLocationFP


toTitleCase

Re-exports toTitleCase


toUpperCase

Re-exports toUpperCase


trackTimeout

Re-exports trackTimeout


trim

Re-exports trim


trimAndToLower

Re-exports trimAndToLower


trimAndToUpper

Re-exports trimAndToUpper


trimEnd

Re-exports trimEnd


trimEndFP

Re-exports trimEndFP


trimFP

Re-exports trimFP


trimISODateSegment

Re-exports trimISODateSegment


trimStart

Re-exports trimStart


trimStartFP

Re-exports trimStartFP


truncate

Re-exports truncate


truncateFP

Re-exports truncateFP


tryParseJSON

Re-exports tryParseJSON


tzCacheLoaded

Re-exports tzCacheLoaded


unescapeString

Re-exports unescapeString


uniq

Re-exports uniq


uniqBy

Re-exports uniqBy


validateByteNumber

Re-exports validateByteNumber


validateIntegerNumber

Re-exports validateIntegerNumber


validateListCoords

Re-exports validateListCoords


validateNumberType

Re-exports validateNumberType


validateShortNumber

Re-exports validateShortNumber


waterfall

Re-exports waterfall


wildCardToRegex

Re-exports wildCardToRegex


withoutNil

Re-exports withoutNil

Type Aliases

Diff<T, U>

Diff<T, U>: T extends U ? never : T

Remove types from T that are assignable to U

Type parameters

Type parameter
T
U

Source

packages/types/dist/src/utility.d.ts:74


Filter<T, U>

Filter<T, U>: T extends U ? T : never

Remove types from T that are NOT assignable to U

Type parameters

Type parameter
T
U

Source

packages/types/dist/src/utility.d.ts:78


FilteredResult<T, I, E>

FilteredResult<T, I, E>: { [P in keyof T]: P extends I ? T[P] : P extends E ? never : T[P] }

Filters the keys of an object (T), by list of included keys (I) and excluded (E)

Type parameters

Type parameter
T
I extends keyof T
E extends keyof T

Source

packages/types/dist/src/utility.d.ts:86


Nil

Nil: null | undefined

Source

packages/types/dist/src/utility.d.ts:43


Omit<T, K>

Omit<T, K>: Pick<T, Exclude<keyof T, K>>

Omit the properties available to type. Useful for excluding properties from a type

Example

`Omit<{ a: number, b: number, c: number }, 'b'|'c'> // => { a: 1 }`

Type parameters

Type parameter
T
K extends keyof T

Source

packages/types/dist/src/utility.d.ts:7


Optional<T, K>

Optional<T, K>: { [P in keyof T]: P extends K ? NonNullable<T[P]> | undefined : NonNullable<T[P]> }

Like Partial but makes certain properties optional

Example

`Optional<{ a: number, b: number }, 'b'>`

Type parameters

Type parameter
T
K extends keyof T

Source

packages/types/dist/src/utility.d.ts:40


Override<T1, T2>

Override<T1, T2>: { [P in keyof T1]: P extends keyof T1 ? T2[P] : T1[P] }

Override specific properties on a type

Example

`Override<{ a: number, b: number }, { b: string }>`

Type parameters

Type parameter
T1
T2 extends { [P in keyof T2]: P extends keyof T1 ? T2[P] : never }

Source

packages/types/dist/src/utility.d.ts:22


Overwrite<T1, T2>

Overwrite<T1, T2>: { [P in Exclude<keyof T1, keyof T2>]: T1[P] } & T2

Overwrite a simple type with different properties. Useful changing and adding additional properties

Example

`Overwrite<{ a: number, b: number }, { b?: number }>`

Type parameters

Type parameter
T1
T2

Source

packages/types/dist/src/utility.d.ts:14


PartialDeep<T>

PartialDeep<T>: { [P in keyof T]?: PartialDeep<T[P]> }

A deep partial object

Type parameters

Type parameter
T

Source

packages/types/dist/src/utility.d.ts:68


Required<T, K>

Required<T, K>: { [P in keyof T]: P extends K ? NonNullable<T[P]> : NonNullable<T[P]> | undefined }

Like Partial but makes certain properties required

Example

`Required<{ a: number, b: number }, 'b'>`

Type parameters

Type parameter
T
K extends keyof T

Source

packages/types/dist/src/utility.d.ts:32


Unpacked<T>

Unpacked<T>: T extends infer U[] ? U : T extends (...args) => infer U ? U : T extends Promise<infer U> ? U : T

From https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-inference-in-conditional-types

Type parameters

Type parameter
T

Source

packages/types/dist/src/utility.d.ts:92


ValueOf<T>

ValueOf<T>: T[keyof T]

Get the types object (the opposite of keyof)

Type parameters

Type parameter
T

Source

packages/types/dist/src/utility.d.ts:82


WithoutNil<T>

WithoutNil<T>: { [P in keyof T]: T[P] extends Nil ? never : T[P] }

Without null or undefined properties

Type parameters

Type parameter
T

Source

packages/types/dist/src/utility.d.ts:49