Job Components: `index`
Table of contents
References
- APIConfig
- APIConstructor
- APICore
- APICoreConstructor
- APIFactory
- APIFactoryRegistry
- APIModule
- ASSET_KEYWORD
- AssetBundleType
- AssetRepository
- AssetRepositoryKey
- AssetsAPI
- Assignment
- BatchProcessor
- BundledAPIOperation
- BundledObserverOperation
- BundledProcessorOperation
- BundledReaderOperation
- CachedClients
- ClientFactoryFn
- ClusterManagerType
- ClusterStateConfig
- CollectProcessor
- ConnectionConfig
- Context
- ContextAPIs
- ContextApis
- ContextClusterConfig
- ConvictSchema
- CoreOperation
- CreateClientFactoryFn
- CrossValidationFn
- DeadLetterAPIFn
- DeadLetterAction
- DelayProcessor
- EachProcessor
- EventHandlers
- ExecutionConfig
- ExecutionContext
- ExecutionContextAPI
- ExecutionContextConfig
- ExecutionControllerTargets
- ExecutionStats
- ExternalPort
- Fetcher
- FetcherConstructor
- FetcherCore
- FilterProcessor
- FindOperationResults
- FoundationApis
- GetClientConfig
- IndexRolloverFrequency
- JobAPIInstance
- JobAPIInstances
- JobConfig
- JobObserver
- JobRunnerAPI
- JobValidator
- LegacyExecutionContext
- LegacyFoundationApis
- LegacyOperation
- LegacyProcessor
- LegacyReader
- LifeCycle
- LoaderOptions
- MapProcessor
- NoopProcessor
- Observer
- ObserverConstructor
- OpAPI
- OpAPIFn
- OpAPIInstance
- OpConfig
- OpRunnerAPI
- OpTypeToRepositoryKey
- OperationAPI
- OperationAPIConstructor
- OperationAPIType
- OperationCore
- OperationCoreConstructor
- OperationLifeCycle
- OperationLoader
- OperationLocationType
- OperationModule
- OperationResults
- OperationTypeName
- ParallelSlicer
- ParallelSlicerConstructor
- ProcessorConstructor
- ProcessorCore
- ProcessorFn
- ProcessorModule
- ReaderFn
- ReaderModule
- RecoveryCleanupType
- RepositoryOperation
- RolloverFrequency
- RunSliceResult
- SchemaConstructor
- SchemaCore
- SchemaModule
- SelfValidationFn
- SingleSlicerConstructor
- Slice
- SliceAnalyticsData
- SliceQueueLengthFn
- SliceRequest
- SliceResult
- SliceStatus
- Slicer
- SlicerConstructor
- SlicerCore
- SlicerCoreConstructor
- SlicerExecutionContext
- SlicerFn
- SlicerFns
- SlicerOperationLifeCycle
- SlicerOperations
- SlicerRecoveryData
- SlicerResult
- SysConfig
- Targets
- TerafoundationConfig
- TerasliceConfig
- TestClientConfig
- TestClients
- TestClientsByEndpoint
- TestContext
- TestContextAPIs
- TestContextOptions
- TestReaderFetcher
- TestReaderSlicer
- ValidLoaderOptions
- ValidatedJobConfig
- Volume
- WorkerContext
- WorkerContextAPIs
- WorkerExecutionContext
- WorkerOperationLifeCycle
- WorkerOperations
- WorkerSliceState
- WorkerStatus
- addFormats
- apiSchema
- formats
- getAssetPath
- getClient
- getClientAsync
- getMetric
- getOpConfig
- getOperationAPIType
- isOperationAPI
- isSlicerContext
- isSlicerExecutionContext
- isWorkerContext
- isWorkerExecutionContext
- jobSchema
- legacyProcessorShim
- legacyReaderShim
- legacySliceEventsShim
- makeContextLogger
- makeExContextLogger
- makeExecutionContext
- makeJobSchema
- newTestExecutionConfig
- newTestExecutionContext
- newTestJobConfig
- newTestSlice
- opSchema
- operationAPIShim
- processorShim
- readerShim
- registerApis
- schemaShim
- sliceAnalyticsMetrics
- validateAPIConfig
- validateJobConfig
- validateOpConfig
Namespaces
Enumerations
Classes
Interfaces
- AnyObject
- DataEntityMetadata
- ElasticsearchError
- EmptyObject
- EncodingConfig
- InNumberRangeArg
- ListOfRecursiveArraysOrValues
- Many
- PRetryConfig
- RecursiveArray
- RouteSenderAPI
- TSErrorConfig
- TSErrorContext
Type Aliases
- AdjustDateArgs
- DataArrayInput
- DataEntityMetadataValue
- DataInput
- Diff
- EntityMetadataValue
- Filter
- FilteredResult
- Nil
- Omit
- Optional
- Override
- Overwrite
- PWhileOptions
- PartialDeep
- Required
- StringEntropyFN
- TYPE_ENTITY_METADATA_KEY
- TYPE_IS_DATAENTITY_KEY
- Unpacked
- ValueOf
- WithoutNil
- _DataEntityMetadata
- _DataEntityMetadataType
Variables
- LOWER_CASE_CHARS
- MAX_STRING_LENGTH_BEFORE_MD5
- NUM_CHARS
- STATUS_CODES
- UPPER_CASE_CHARS
- WORD_CHARS
- WORD_SEPARATOR_CHARS
- __ENTITY_METADATA_KEY
- __IS_DATAENTITY_KEY
- dataEncodings
- geoHash
- geoJSONTypes
- getDurationFunc
- isCI
- isDev
- isProd
- isTest
- logLevels
- timezoneOffset
Functions
- addToDate
- addToDateFP
- and
- bigIntToJSON
- castArray
- chunk
- chunkIter
- clone
- cloneDeep
- coerceToGeoBoundary
- coerceToGeoPoint
- coerceToNumberType
- coerceToType
- concat
- configurable
- contains
- containsFP
- debugLogger
- endsWith
- endsWithFP
- ensureBuffer
- enumerable
- escapeString
- extractMappedIPv4
- fastAssign
- fastCloneDeep
- filterObject
- firstToLower
- firstToUpper
- flatten
- flattenDeep
- formatDateValue
- formatRegex
- geoContains
- geoContainsFP
- geoDisjoint
- geoDisjointFP
- geoIntersects
- geoIntersectsFP
- geoPointWithinRange
- geoPointWithinRangeFP
- geoPolyHasPoint
- geoRelationFP
- geoWithin
- geoWithinFP
- getBackoffDelay
- getCIDRBroadcast
- getCIDRMax
- getCIDRMin
- getCIDRNetwork
- getDate
- getErrorStatusCode
- getField
- getFirst
- getFirstChar
- getFirstIPInCIDR
- getFirstKey
- getFirstUsableIPInCIDR
- getFirstValue
- getFullErrorStack
- getHashCodeFrom
- getHours
- getLast
- getLastIPInCIDR
- getLastUsableIPInCIDR
- getMilliseconds
- getMinutes
- getMonth
- getSeconds
- getTime
- getTimeBetween
- getTimeBetweenFP
- getTimezoneOffset
- getTimezoneOffsetFP
- getTypeOf
- getUTCDate
- getUTCHours
- getUTCMinutes
- getUTCMonth
- getUTCYear
- getUnixTime
- getValidDate
- getValidDateOrNumberOrThrow
- getValidDateOrThrow
- getValidDateWithTimezone
- getValidDateWithTimezoneOrThrow
- getWordParts
- getYear
- hasOwn
- inGeoBoundingBox
- inGeoBoundingBoxFP
- inIPRange
- inNumberRange
- inNumberRangeFP
- includes
- intToIP
- ipToInt
- isAfter
- isAlpha
- isAlphaNumeric
- isArray
- isArrayLike
- isAsyncIterator
- isBase64
- isBefore
- isBetween
- isBigInt
- isBoolean
- isBooleanLike
- isBuffer
- isCIDR
- isCountryCode
- isDateTuple
- isDeepEqual
- isDeepEqualFP
- isElasticsearchError
- isEmail
- isEmpty
- isEqual
- isEqualFP
- isError
- isFQDN
- isFalsy
- isFatalError
- isFloat
- isFriday
- isFunction
- isFuture
- isGeoJSON
- isGeoPoint
- isGeoShapeMultiPolygon
- isGeoShapePoint
- isGeoShapePolygon
- isGreaterThan
- isGreaterThanFP
- isGreaterThanOrEqualTo
- isGreaterThanOrEqualToFP
- isIP
- isIPOrThrow
- isIPRangeOrThrow
- isIPv4
- isIPv6
- isISDN
- isISO8601
- isInteger
- isIterator
- isLeapYear
- isLessThan
- isLessThanFP
- isLessThanOrEqualTo
- isLessThanOrEqualToFP
- isMACAddress
- isMACAddressFP
- isMIMEType
- isMappedIPv4
- isMonday
- isNil
- isNonRoutableIP
- isNonZeroCidr
- isNotNil
- isNumber
- isNumberLike
- isObjectEntity
- isPast
- isPhoneNumberLike
- isPlainObject
- isPort
- isPostalCode
- isPrimitiveValue
- isRegExp
- isRegExpLike
- isRetryableError
- isRoutableIP
- isSame
- isSaturday
- isSimpleObject
- isString
- isSunday
- isTSError
- isThursday
- isToday
- isTomorrow
- isTruthy
- isTuesday
- isTypedArray
- isURL
- isUUID
- isUnixTime
- isUnixTimeFP
- isValidDate
- isValidDateInstance
- isValidateNumberType
- isWednesday
- isWeekday
- isWeekend
- isWildCardString
- isYesterday
- joinList
- locked
- logError
- lookup
- lookupTimezone
- makeCoordinatesFromGeoPoint
- makeGeoBBox
- makeGeoCircle
- makeGeoFeature
- makeGeoFeatureOrThrow
- makeISODate
- mapKeys
- mapValues
- match
- matchAll
- matchAllFP
- matchFP
- matchWildcard
- md5
- memoize
- noop
- not
- once
- or
- pDefer
- pDelay
- pImmediate
- pRace
- pRaceWithTimeout
- pRetry
- pWhile
- parseCustomDateFormat
- parseDateValue
- parseError
- parseErrorInfo
- parseGeoDistance
- parseGeoDistanceUnit
- parseGeoPoint
- parseJSON
- parseList
- parseNumberList
- parsePhoneNumber
- polyHasHoles
- prefixErrorMsg
- primitiveToString
- random
- reverseIP
- setDate
- setHours
- setMilliseconds
- setMinutes
- setMonth
- setPrecision
- setPrecisionFP
- setSeconds
- setTimezone
- setTimezoneFP
- setYear
- shannonEntropy
- shortenIPv6Address
- sort
- sortBy
- sortKeys
- startsWith
- startsWithFP
- stringEntropy
- stripErrorMessage
- subtractFromDate
- subtractFromDateFP
- times
- timesIter
- timezoneToOffset
- toBigInt
- toBigIntOrThrow
- toBoolean
- toBooleanOrThrow
- toCIDR
- toCamelCase
- toCelsius
- toEpochMSOrThrow
- toFahrenheit
- toFloat
- toFloatOrThrow
- toGeoJSON
- toGeoJSONOrThrow
- toHumanTime
- toISO8601
- toInteger
- toIntegerOrThrow
- toJSONCompatibleValue
- toKebabCase
- toLowerCase
- toNumber
- toNumberOrThrow
- toPascalCase
- toSafeString
- toSnakeCase
- toStatusErrorCode
- toString
- toTimeZone
- toTimeZoneUsingLocation
- toTimeZoneUsingLocationFP
- toTitleCase
- toUpperCase
- trackTimeout
- trim
- trimAndToLower
- trimAndToUpper
- trimEnd
- trimEndFP
- trimFP
- trimISODateSegment
- trimStart
- trimStartFP
- truncate
- truncateFP
- tryParseJSON
- tzCacheLoaded
- unescapeString
- uniq
- uniqBy
- validateByteNumber
- validateIntegerNumber
- validateListCoords
- validateNumberType
- validateShortNumber
- waterfall
- wildCardToRegex
- withoutNil
References
APIConfig
Re-exports APIConfig
APIConstructor
Re-exports APIConstructor
APICore
Renames and re-exports default
APICoreConstructor
Re-exports APICoreConstructor
APIFactory
Renames and re-exports default
APIFactoryRegistry
Re-exports APIFactoryRegistry
APIModule
Re-exports APIModule
ASSET_KEYWORD
Re-exports ASSET_KEYWORD
AssetBundleType
Re-exports AssetBundleType
AssetRepository
Re-exports AssetRepository
AssetRepositoryKey
Re-exports AssetRepositoryKey
AssetsAPI
Re-exports AssetsAPI
Assignment
Re-exports Assignment
BatchProcessor
Renames and re-exports default
BundledAPIOperation
Re-exports BundledAPIOperation
BundledObserverOperation
Re-exports BundledObserverOperation
BundledProcessorOperation
Re-exports BundledProcessorOperation
BundledReaderOperation
Re-exports BundledReaderOperation
CachedClients
Re-exports CachedClients
ClientFactoryFn
Re-exports ClientFactoryFn
ClusterManagerType
Re-exports ClusterManagerType
ClusterStateConfig
Re-exports ClusterStateConfig
CollectProcessor
Renames and re-exports default
ConnectionConfig
Re-exports ConnectionConfig
Context
Re-exports Context
ContextAPIs
Re-exports ContextAPIs
ContextApis
Re-exports ContextApis
ContextClusterConfig
Re-exports ContextClusterConfig
ConvictSchema
Renames and re-exports default
CoreOperation
Re-exports CoreOperation
CreateClientFactoryFn
Re-exports CreateClientFactoryFn
CrossValidationFn
Re-exports CrossValidationFn
DeadLetterAPIFn
Re-exports DeadLetterAPIFn
DeadLetterAction
Re-exports DeadLetterAction
DelayProcessor
Renames and re-exports default
EachProcessor
Renames and re-exports default
EventHandlers
Re-exports EventHandlers
ExecutionConfig
Re-exports ExecutionConfig
ExecutionContext
Re-exports ExecutionContext
ExecutionContextAPI
Re-exports ExecutionContextAPI
ExecutionContextConfig
Re-exports ExecutionContextConfig
ExecutionControllerTargets
Re-exports ExecutionControllerTargets
ExecutionStats
Re-exports ExecutionStats
ExternalPort
Re-exports ExternalPort
Fetcher
Renames and re-exports default
FetcherConstructor
Re-exports FetcherConstructor
FetcherCore
Renames and re-exports default
FilterProcessor
Renames and re-exports default
FindOperationResults
Re-exports FindOperationResults
FoundationApis
Re-exports FoundationApis
GetClientConfig
Re-exports GetClientConfig
IndexRolloverFrequency
Re-exports IndexRolloverFrequency
JobAPIInstance
Re-exports JobAPIInstance
JobAPIInstances
Re-exports JobAPIInstances
JobConfig
Re-exports JobConfig
JobObserver
Renames and re-exports default
JobRunnerAPI
Re-exports JobRunnerAPI
JobValidator
Re-exports JobValidator
LegacyExecutionContext
Re-exports LegacyExecutionContext
LegacyFoundationApis
Re-exports LegacyFoundationApis
LegacyOperation
Re-exports LegacyOperation
LegacyProcessor
Re-exports LegacyProcessor
LegacyReader
Re-exports LegacyReader
LifeCycle
Re-exports LifeCycle
LoaderOptions
Re-exports LoaderOptions
MapProcessor
Renames and re-exports default
NoopProcessor
Renames and re-exports default
Observer
Renames and re-exports default
ObserverConstructor
Re-exports ObserverConstructor
OpAPI
Re-exports OpAPI
OpAPIFn
Re-exports OpAPIFn
OpAPIInstance
Re-exports OpAPIInstance
OpConfig
Re-exports OpConfig
OpRunnerAPI
Re-exports OpRunnerAPI
OpTypeToRepositoryKey
Re-exports OpTypeToRepositoryKey
OperationAPI
Renames and re-exports default
OperationAPIConstructor
Re-exports OperationAPIConstructor
OperationAPIType
Re-exports OperationAPIType
OperationCore
Renames and re-exports default
OperationCoreConstructor
Re-exports OperationCoreConstructor
OperationLifeCycle
Re-exports OperationLifeCycle
OperationLoader
Re-exports OperationLoader
OperationLocationType
Re-exports OperationLocationType
OperationModule
Re-exports OperationModule
OperationResults
Re-exports OperationResults
OperationTypeName
Re-exports OperationTypeName
ParallelSlicer
Renames and re-exports default
ParallelSlicerConstructor
Re-exports ParallelSlicerConstructor
ProcessorConstructor
Re-exports ProcessorConstructor
ProcessorCore
Renames and re-exports default
ProcessorFn
Re-exports ProcessorFn
ProcessorModule
Re-exports ProcessorModule
ReaderFn
Re-exports ReaderFn
ReaderModule
Re-exports ReaderModule
RecoveryCleanupType
Re-exports RecoveryCleanupType
RepositoryOperation
Re-exports RepositoryOperation
RolloverFrequency
Re-exports RolloverFrequency
RunSliceResult
Re-exports RunSliceResult
SchemaConstructor
Re-exports SchemaConstructor
SchemaCore
Renames and re-exports default
SchemaModule
Re-exports SchemaModule
SelfValidationFn
Re-exports SelfValidationFn
SingleSlicerConstructor
Re-exports SingleSlicerConstructor
Slice
Re-exports Slice
SliceAnalyticsData
Re-exports SliceAnalyticsData
SliceQueueLengthFn
Re-exports SliceQueueLengthFn
SliceRequest
Re-exports SliceRequest
SliceResult
Re-exports SliceResult
SliceStatus
Re-exports SliceStatus
Slicer
Renames and re-exports default
SlicerConstructor
Re-exports SlicerConstructor
SlicerCore
Renames and re-exports default
SlicerCoreConstructor
Re-exports SlicerCoreConstructor
SlicerExecutionContext
Re-exports SlicerExecutionContext
SlicerFn
Re-exports SlicerFn
SlicerFns
Re-exports SlicerFns
SlicerOperationLifeCycle
Re-exports SlicerOperationLifeCycle
SlicerOperations
Re-exports SlicerOperations
SlicerRecoveryData
Re-exports SlicerRecoveryData
SlicerResult
Re-exports SlicerResult
SysConfig
Re-exports SysConfig
Targets
Re-exports Targets
TerafoundationConfig
Re-exports TerafoundationConfig
TerasliceConfig
Re-exports TerasliceConfig
TestClientConfig
Re-exports TestClientConfig
TestClients
Re-exports TestClients
TestClientsByEndpoint
Re-exports TestClientsByEndpoint
TestContext
Re-exports TestContext
TestContextAPIs
Re-exports TestContextAPIs
TestContextOptions
Re-exports TestContextOptions
TestReaderFetcher
Renames and re-exports default
TestReaderSlicer
Renames and re-exports default
ValidLoaderOptions
Re-exports ValidLoaderOptions
ValidatedJobConfig
Re-exports ValidatedJobConfig
Volume
Re-exports Volume
WorkerContext
Re-exports WorkerContext
WorkerContextAPIs
Re-exports WorkerContextAPIs
WorkerExecutionContext
Re-exports WorkerExecutionContext
WorkerOperationLifeCycle
Re-exports WorkerOperationLifeCycle
WorkerOperations
Re-exports WorkerOperations
WorkerSliceState
Re-exports WorkerSliceState
WorkerStatus
Re-exports WorkerStatus
addFormats
Re-exports addFormats
apiSchema
Re-exports apiSchema
formats
Re-exports formats
getAssetPath
Re-exports getAssetPath
getClient
Re-exports getClient
getClientAsync
Re-exports getClientAsync
getMetric
Re-exports getMetric
getOpConfig
Re-exports getOpConfig
getOperationAPIType
Re-exports getOperationAPIType
isOperationAPI
Re-exports isOperationAPI
isSlicerContext
Re-exports isSlicerContext
isSlicerExecutionContext
Re-exports isSlicerExecutionContext
isWorkerContext
Re-exports isWorkerContext
isWorkerExecutionContext
Re-exports isWorkerExecutionContext
jobSchema
Re-exports jobSchema
legacyProcessorShim
Renames and re-exports default
legacyReaderShim
Renames and re-exports default
legacySliceEventsShim
Renames and re-exports default
makeContextLogger
Re-exports makeContextLogger
makeExContextLogger
Re-exports makeExContextLogger
makeExecutionContext
Re-exports makeExecutionContext
makeJobSchema
Re-exports makeJobSchema
newTestExecutionConfig
Re-exports newTestExecutionConfig
newTestExecutionContext
Re-exports newTestExecutionContext
newTestJobConfig
Re-exports newTestJobConfig
newTestSlice
Re-exports newTestSlice
opSchema
Re-exports opSchema
operationAPIShim
Renames and re-exports default
processorShim
Renames and re-exports default
readerShim
Renames and re-exports default
registerApis
Re-exports registerApis
schemaShim
Renames and re-exports default
sliceAnalyticsMetrics
Re-exports sliceAnalyticsMetrics
validateAPIConfig
Re-exports validateAPIConfig
validateJobConfig
Re-exports validateJobConfig
validateOpConfig
Re-exports validateOpConfig
Type Aliases
AdjustDateArgs
Ƭ AdjustDateArgs: { expr
: string
} | { days?
: number
; hours?
: number
; milliseconds?
: number
; minutes?
: number
; months?
: number
; seconds?
: number
; weeks?
: number
; years?
: number
}
Defined in
packages/utils/dist/src/dates.d.ts:144
DataArrayInput
Ƭ DataArrayInput: DataInput
| DataInput
[]
Defined in
packages/utils/dist/src/entities/data-entity.d.ts:153
DataEntityMetadataValue
Ƭ DataEntityMetadataValue<M
>: keyof DataEntityMetadata
| keyof M
| string
| number
Type parameters
Name |
---|
M |
Defined in
packages/utils/dist/src/entities/interfaces.d.ts:8
DataInput
Ƭ DataInput: Record
<string
, any
> | DataEntity
Defined in
packages/utils/dist/src/entities/data-entity.d.ts:152
Diff
Ƭ Diff<T
, U
>: T
extends U
? never
: T
Remove types from T that are assignable to U
Type parameters
Name |
---|
T |
U |
Defined in
packages/types/dist/src/utility.d.ts:74
EntityMetadataValue
Ƭ EntityMetadataValue<M
, K
>: K
extends keyof DataEntityMetadata
? DataEntityMetadata
[K
] : K
extends keyof M
? M
[K
] : any
Type parameters
Name |
---|
M |
K |
Defined in
packages/utils/dist/src/entities/interfaces.d.ts:9
Filter
Ƭ Filter<T
, U
>: T
extends U
? T
: never
Remove types from T that are NOT assignable to U
Type parameters
Name |
---|
T |
U |
Defined in
packages/types/dist/src/utility.d.ts:78
FilteredResult
Ƭ 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
Name | Type |
---|---|
T | T |
I | extends keyof T |
E | extends keyof T |
Defined in
packages/types/dist/src/utility.d.ts:86
Nil
Ƭ Nil: null
| undefined
Defined in
packages/types/dist/src/utility.d.ts:43
Omit
Ƭ 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
Name | Type |
---|---|
T | T |
K | extends keyof T |
Defined in
packages/types/dist/src/utility.d.ts:7
Optional
Ƭ 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
Name | Type |
---|---|
T | T |
K | extends keyof T |
Defined in
packages/types/dist/src/utility.d.ts:40
Override
Ƭ 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
Name | Type |
---|---|
T1 | T1 |
T2 | extends { [P in keyof T2]: P extends keyof T1 ? T2[P] : never } |
Defined in
packages/types/dist/src/utility.d.ts:22
Overwrite
Ƭ 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
Name |
---|
T1 |
T2 |
Defined in
packages/types/dist/src/utility.d.ts:14
PWhileOptions
Ƭ PWhileOptions: Object
Type declaration
Name | Type | Description |
---|---|---|
enabledJitter? | boolean | enable jitter to stagger requests |
error? | string | error that can be expressed if the timer ends because the function does not return true |
maxJitter? | number | the maximum the jitter wait time will be (in milliseconds), defaults to 3x the minJitter setting, but less than timeoutMs |
minJitter? | number | the minimum the jitter wait time will be (in milliseconds), defaults to 100ms |
name? | string | Defaults to "Request" |
timeoutMs? | number | Defaults to -1 which is never |
Defined in
packages/utils/dist/src/promises.d.ts:54
PartialDeep
Ƭ PartialDeep<T
>: { [P in keyof T]?: PartialDeep<T[P]> }
A deep partial object
Type parameters
Name |
---|
T |
Defined in
packages/types/dist/src/utility.d.ts:68
Required
Ƭ 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
Name | Type |
---|---|
T | T |
K | extends keyof T |
Defined in
packages/types/dist/src/utility.d.ts:32
StringEntropyFN
Ƭ StringEntropyFN: (input
: unknown
) => number
Type declaration
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/strings.d.ts:269
TYPE_ENTITY_METADATA_KEY
Ƭ TYPE_ENTITY_METADATA_KEY: "___EntityMetadata"
Defined in
packages/utils/dist/src/entities/interfaces.d.ts:3
TYPE_IS_DATAENTITY_KEY
Ƭ TYPE_IS_DATAENTITY_KEY: "__isDataEntity"
Defined in
packages/utils/dist/src/entities/interfaces.d.ts:2
Unpacked
Ƭ Unpacked<T
>: T
extends infer U[] ? U
: T
extends (...args
: any
[]) => 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
Name |
---|
T |
Defined in
packages/types/dist/src/utility.d.ts:92
ValueOf
Ƭ ValueOf<T
>: T
[keyof T
]
Get the types object (the opposite of keyof)
Type parameters
Name |
---|
T |
Defined in
packages/types/dist/src/utility.d.ts:82
WithoutNil
Ƭ WithoutNil<T
>: { [P in keyof T]: T[P] extends Nil ? never : T[P] }
Without null or undefined properties
Type parameters
Name |
---|
T |
Defined in
packages/types/dist/src/utility.d.ts:49
_DataEntityMetadata
Ƭ _DataEntityMetadata<M
>: M
& DataEntityMetadata
& AnyObject
Type parameters
Name |
---|
M |
Defined in
packages/utils/dist/src/entities/interfaces.d.ts:7
_DataEntityMetadataType
Ƭ _DataEntityMetadataType: DataEntityMetadata
| AnyObject
Defined in
packages/utils/dist/src/entities/interfaces.d.ts:6
Variables
LOWER_CASE_CHARS
• Const
LOWER_CASE_CHARS: Object
Type declaration
Name | Type |
---|---|
a | true |
b | true |
c | true |
d | true |
e | true |
f | true |
g | true |
h | true |
i | true |
j | true |
k | true |
l | true |
m | true |
n | true |
o | true |
p | true |
q | true |
r | true |
s | true |
t | true |
u | true |
v | true |
w | true |
x | true |
y | true |
z | true |
Defined in
packages/utils/dist/src/strings.d.ts:76
MAX_STRING_LENGTH_BEFORE_MD5
• Const
MAX_STRING_LENGTH_BEFORE_MD5: 1024
If we have a hash that is a long value we want to ensure that the value doesn't explode the memory since we may be using that value as a key. So when a string exceeds this specified length we can reduce its length to 35 characters by using md5
Defined in
packages/utils/dist/src/type-coercion.d.ts:25
NUM_CHARS
• Const
NUM_CHARS: Object
Type declaration
Name | Type |
---|---|
0 | true |
1 | true |
2 | true |
3 | true |
4 | true |
5 | true |
6 | true |
7 | true |
8 | true |
9 | true |
Defined in
packages/utils/dist/src/strings.d.ts:132
STATUS_CODES
• Const
STATUS_CODES: Object
Type declaration
Name | Type |
---|---|
100 | string |
101 | string |
102 | string |
103 | string |
200 | string |
201 | string |
202 | string |
203 | string |
204 | string |
205 | string |
206 | string |
207 | string |
208 | string |
226 | string |
300 | string |
301 | string |
302 | string |
303 | string |
304 | string |
305 | string |
307 | string |
308 | string |
400 | string |
401 | string |
402 | string |
403 | string |
404 | string |
405 | string |
406 | string |
407 | string |
408 | string |
409 | string |
410 | string |
411 | string |
412 | string |
413 | string |
414 | string |
415 | string |
416 | string |
417 | string |
418 | string |
421 | string |
422 | string |
423 | string |
424 | string |
425 | string |
426 | string |
428 | string |
429 | string |
431 | string |
451 | string |
500 | string |
501 | string |
502 | string |
503 | string |
504 | string |
505 | string |
506 | string |
507 | string |
508 | string |
509 | string |
510 | string |
511 | string |
Defined in
packages/utils/dist/src/status-codes.d.ts:1
UPPER_CASE_CHARS
• Const
UPPER_CASE_CHARS: Object
Type declaration
Name | Type |
---|---|
A | true |
B | true |
C | true |
D | true |
E | true |
F | true |
G | true |
H | true |
I | true |
J | true |
K | true |
L | true |
M | true |
N | true |
O | true |
P | true |
Q | true |
R | true |
S | true |
T | true |
U | true |
V | true |
W | true |
X | true |
Y | true |
Z | true |
Defined in
packages/utils/dist/src/strings.d.ts:104
WORD_CHARS
• Const
WORD_CHARS: Object
Type declaration
Name | Type |
---|---|
0 | true |
1 | true |
2 | true |
3 | true |
4 | true |
5 | true |
6 | true |
7 | true |
8 | true |
9 | true |
A | true |
B | true |
C | true |
D | true |
E | true |
F | true |
G | true |
H | true |
I | true |
J | true |
K | true |
L | true |
M | true |
N | true |
O | true |
P | true |
Q | true |
R | true |
S | true |
T | true |
U | true |
V | true |
W | true |
X | true |
Y | true |
Z | true |
a | true |
b | true |
c | true |
d | true |
e | true |
f | true |
g | true |
h | true |
i | true |
j | true |
k | true |
l | true |
m | true |
n | true |
o | true |
p | true |
q | true |
r | true |
s | true |
t | true |
u | true |
v | true |
w | true |
x | true |
y | true |
z | true |
Defined in
packages/utils/dist/src/strings.d.ts:149
WORD_SEPARATOR_CHARS
• Const
WORD_SEPARATOR_CHARS: Object
Type declaration
Name | Type |
---|---|
| true |
- | true |
_ | true |
Defined in
packages/utils/dist/src/strings.d.ts:144
__ENTITY_METADATA_KEY
• Const
__ENTITY_METADATA_KEY: TYPE_ENTITY_METADATA_KEY
Defined in
packages/utils/dist/src/entities/interfaces.d.ts:5
__IS_DATAENTITY_KEY
• Const
__IS_DATAENTITY_KEY: TYPE_IS_DATAENTITY_KEY
Defined in
packages/utils/dist/src/entities/interfaces.d.ts:4
dataEncodings
• Const
dataEncodings: readonly DataEncoding
[]
A list of supported encoding formats
Defined in
packages/utils/dist/src/entities/interfaces.d.ts:52
geoHash
• geoHash: Object
Type declaration
Name | Type | |||
---|---|---|---|---|
adjacent | (geoHash : string , direction : "N" \ | "S" \ | "E" \ | "W" ) => any |
bounds | (geoHash : string ) => { ne : number ; sw : number } | |||
decode | (geoHash : string ) => { lat : number ; lon : number } | |||
encode | (lat : number , lon : number , precision? : number ) => string | |||
neighbours | (geoHash : string ) => { n : number ; ne : number ; nw : number ; s : number ; se : number ; sw : number ; w : number } |
Defined in
types/latlon-geohash/index.d.ts:34
geoJSONTypes
• Const
geoJSONTypes: string
[]
Defined in
packages/utils/dist/src/geo.d.ts:3
getDurationFunc
• Const
getDurationFunc: Object
Type declaration
Name | Type |
---|---|
ISOWeekYears | typeof differenceInISOWeekYears |
businessDays | typeof differenceInBusinessDays |
calendarDays | typeof differenceInCalendarDays |
calendarISOWeekYears | typeof differenceInCalendarISOWeekYears |
calendarMonths | typeof differenceInCalendarMonths |
calendarQuarters | typeof differenceInCalendarQuarters |
calendarWeeks | typeof differenceInCalendarISOWeeks |
calendarYears | typeof differenceInCalendarYears |
days | typeof differenceInDays |
hours | typeof differenceInHours |
milliseconds | typeof differenceInMilliseconds |
minutes | typeof differenceInMinutes |
months | typeof differenceInMonths |
quarters | typeof differenceInQuarters |
seconds | typeof differenceInSeconds |
weeks | typeof differenceInWeeks |
years | typeof differenceInYears |
Defined in
packages/utils/dist/src/dates.d.ts:105
isCI
• Const
isCI: boolean
Defined in
packages/utils/dist/src/env.d.ts:4
isDev
• Const
isDev: boolean
Defined in
packages/utils/dist/src/env.d.ts:3
isProd
• Const
isProd: boolean
Defined in
packages/utils/dist/src/env.d.ts:1
isTest
• Const
isTest: boolean
Defined in
packages/utils/dist/src/env.d.ts:2
logLevels
• Const
logLevels: Object
Type declaration
Name | Type |
---|---|
debug | number |
error | number |
fatal | number |
info | number |
trace | number |
warn | number |
Defined in
packages/utils/dist/src/logger.d.ts:8
timezoneOffset
• Const
timezoneOffset: number
Defined in
packages/utils/dist/src/dates.d.ts:19
Functions
addToDate
▸ addToDate(input
, args
): number
Parameters
Name | Type |
---|---|
input | unknown |
args | AdjustDateArgs |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:156
addToDateFP
▸ addToDateFP(args
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
args | AdjustDateArgs |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:157
and
▸ and<T
>(...fns
): T
Curry one or more functions, where all must returned truthy values
Type parameters
Name | Type |
---|---|
T | extends AnyFn |
Parameters
Name | Type |
---|---|
...fns | T [] |
Returns
T
Defined in
packages/utils/dist/src/fp.d.ts:9
bigIntToJSON
▸ bigIntToJSON(int
): string
| number
Convert a BigInt to either a number or a string
Parameters
Name | Type |
---|---|
int | bigint |
Returns
string
| number
Defined in
packages/utils/dist/src/numbers.d.ts:19
castArray
▸ castArray<T
>(input
): T
[]
A simplified implementation of lodash castArray
Type parameters
Name |
---|
T |
Parameters
Name | Type | ||||
---|---|---|---|---|---|
input | undefined \ | null \ | T \ | T [] \ | readonly T [] |
Returns
T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:7
chunk
▸ chunk<T
>(dataArray
, size
): T
[][]
Chunk an array into specific sizes
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
dataArray | Iterable <T > |
size | number |
Returns
T
[][]
Defined in
packages/utils/dist/src/arrays.d.ts:32
chunkIter
▸ chunkIter<T
>(dataArray
, size
): Iterable
<T
[]>
Chunk an array into specific size, by using an iterator
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
dataArray | Iterable <T > |
size | number |
Returns
Iterable
<T
[]>
Defined in
packages/utils/dist/src/arrays.d.ts:34
clone
▸ clone(input
): any
Shallow clone an object
Parameters
Name | Type |
---|---|
input | unknown |
Returns
any
Defined in
packages/utils/dist/src/deps.d.ts:19
cloneDeep
▸ cloneDeep<T
>(input
): T
Type parameters
Name | Type |
---|---|
T | any |
Parameters
Name | Type |
---|---|
input | T |
Returns
T
Defined in
packages/utils/dist/src/deps.d.ts:20
coerceToGeoBoundary
▸ coerceToGeoBoundary(input
): GeoBoundary
Convert value to a GeoBoundary data type, a GeoBoundary is two GeoPoints, one representing the top left, the other representing the bottom right
Parameters
Name | Type |
---|---|
input | unknown |
Returns
GeoBoundary
Defined in
packages/utils/dist/src/type-coercion.d.ts:18
coerceToGeoPoint
▸ coerceToGeoPoint(input
): GeoPoint
Convert value to a GeoPoint data type
Parameters
Name | Type |
---|---|
input | unknown |
Returns
GeoPoint
Defined in
packages/utils/dist/src/type-coercion.d.ts:12
coerceToNumberType
▸ coerceToNumberType(type
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
type | FieldType |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/type-coercion.d.ts:8
coerceToType
▸ coerceToType<T
>(fieldConfig
, childConfig?
): CoerceFN
<T
>
Will return a function that will coerce the input values to the DataTypeFieldConfig provided. The parameter childConfig is only necessary with Tuple or Object field types
Type parameters
Name | Type |
---|---|
T | unknown |
Parameters
Name | Type |
---|---|
fieldConfig | DataTypeFieldConfig |
childConfig? | DataTypeFields |
Returns
CoerceFN
<T
>
Defined in
packages/utils/dist/src/type-coercion.d.ts:7
concat
▸ concat<T
>(arr
, arr1?
): readonly T
[]
Concat and unique the items in the array Any non-array value will be converted to an array
Type parameters
Name |
---|
T |
Parameters
Name | Type | |
---|---|---|
arr | T \ | T [] |
arr1? | T \ | T [] |
Returns
readonly T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:12
▸ concat<T
>(arr
, arr1?
): readonly T
[]
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
arr | readonly T [] |
arr1? | readonly T [] |
Returns
readonly T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:13
▸ concat<T
>(arr
, arr1?
): readonly T
[]
Type parameters
Name |
---|
T |
Parameters
Name | Type | |
---|---|---|
arr | readonly T [] | |
arr1? | T \ | T [] |
Returns
readonly T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:14
configurable
▸ configurable(value
): (target
: unknown
, propertyKey
: string
, descriptor
: PropertyDescriptor
) => void
A decorator making changing the changing configurable property
Parameters
Name | Type |
---|---|
value | boolean |
Returns
fn
▸ (target
, propertyKey
, descriptor
): void
Parameters
Name | Type |
---|---|
target | unknown |
propertyKey | string |
descriptor | PropertyDescriptor |
Returns
void
Defined in
packages/utils/dist/src/decorators.d.ts:4
contains
▸ contains(input
, substring
): input is string
Check whether a string includes another string
Parameters
Name | Type |
---|---|
input | unknown |
substring | string |
Returns
input is string
Defined in
packages/utils/dist/src/strings.d.ts:246
containsFP
▸ containsFP(substring
): (input
: unknown
) => input is string
A function version of contains
Parameters
Name | Type |
---|---|
substring | string |
Returns
fn
▸ (input
): input is string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is string
Defined in
packages/utils/dist/src/strings.d.ts:250
debugLogger
▸ debugLogger(testName
, param?
, otherName?
): Logger
Parameters
Name | Type |
---|---|
testName | string |
param? | DebugParam |
otherName? | string |
Returns
Defined in
packages/utils/dist/src/logger.d.ts:16
endsWith
▸ endsWith(str
, val
): boolean
A native implementation of lodash endsWith
Parameters
Name | Type |
---|---|
str | unknown |
val | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:65
endsWithFP
▸ endsWithFP(val
): (input
: unknown
) => boolean
A function version of startsWith
Parameters
Name | Type |
---|---|
val | string |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:67
ensureBuffer
▸ ensureBuffer(input
, encoding?
): Buffer
Convert an input to a Buffer if possible
Parameters
Name | Type | |
---|---|---|
input | string \ | Buffer |
encoding? | BufferEncoding |
Returns
Buffer
Defined in
packages/utils/dist/src/buffers.d.ts:5
enumerable
▸ enumerable(enabled?
): (target
: unknown
, propertyKey
: string
, descriptor
: PropertyDescriptor
) => void
A decorator for making a method enumerable or none-enumerable
Parameters
Name | Type |
---|---|
enabled? | boolean |
Returns
fn
▸ (target
, propertyKey
, descriptor
): void
Parameters
Name | Type |
---|---|
target | unknown |
propertyKey | string |
descriptor | PropertyDescriptor |
Returns
void
Defined in
packages/utils/dist/src/decorators.d.ts:6
escapeString
▸ escapeString(input
): string
Escape characters in string and avoid double escaping
Parameters
Name | Type | |
---|---|---|
input | string \ | number |
Returns
string
Defined in
packages/utils/dist/src/deps.d.ts:27
extractMappedIPv4
▸ extractMappedIPv4(input
): string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Defined in
packages/utils/dist/src/ip.d.ts:9
fastAssign
▸ fastAssign<T
, U
>(target
, source
): T
& U
Perform a shallow clone of an object to another, in the fastest way possible
Type parameters
Name | Type |
---|---|
T | extends object |
U | extends object |
Parameters
Name | Type |
---|---|
target | T |
source | U |
Returns
T
& U
Defined in
packages/utils/dist/src/objects.d.ts:25
fastCloneDeep
▸ fastCloneDeep<T
>(input
): T
A clone deep using JSON.parse(JSON.stringify(input))
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
input | T |
Returns
T
Defined in
packages/utils/dist/src/objects.d.ts:23
filterObject
▸ filterObject<T
, I
, E
>(data
, by?
): FilteredResult
<T
, I
, E
>
Filters the keys of an object, by list of included key and excluded
Type parameters
Name | Type | ||
---|---|---|---|
T | extends object | ||
I | extends string \ | number \ | symbol |
E | extends string \ | number \ | symbol |
Parameters
Name | Type |
---|---|
data | T |
by? | Object |
by.excludes? | E [] |
by.includes? | I [] |
Returns
FilteredResult
<T
, I
, E
>
Defined in
packages/utils/dist/src/objects.d.ts:39
firstToLower
▸ firstToLower(str
): string
Change first character in string to lower case
Parameters
Name | Type |
---|---|
str | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:233
firstToUpper
▸ firstToUpper(str
): string
Change first character in string to upper case
Parameters
Name | Type |
---|---|
str | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:231
flatten
▸ flatten<T
>(val
): T
[]
A native implementation of lodash flatten
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
val | Many <T []> |
Returns
T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:4
flattenDeep
▸ flattenDeep<T
>(val
): T
[]
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
val | ListOfRecursiveArraysOrValues <T > |
Returns
T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:5
formatDateValue
▸ formatDateValue(value
, format
): string
| number
Format the parsed date value
Parameters
Name | Type | ||
---|---|---|---|
value | number \ | Date \ | DateTuple |
format | undefined \ | string |
Returns
string
| number
Defined in
packages/utils/dist/src/dates.d.ts:104
formatRegex
▸ formatRegex(input
, flags?
): RegExp
Parameters
Name | Type | |
---|---|---|
input | string \ | RegExp |
flags? | RegexFlag [] |
Returns
RegExp
Defined in
packages/utils/dist/src/regex.d.ts:4
geoContains
▸ geoContains(firstGeoEntity
, secondGeoEntity
): boolean
Returns true if the second geometry is completely contained by the first geometry. The interiors of both geometries must intersect and, the interior and boundary of the secondary geometry must not intersect the exterior of the first geometry.
Parameters
Name | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:35
geoContainsFP
▸ geoContainsFP(queryGeoEntity
): (input
: unknown
) => boolean
When provided with geoInput that acts as the argument geo-feature, it will return a function that accepts any geoInput and checks to see if the new input contains the argument geo-feature
Parameters
Name | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:40
geoDisjoint
▸ geoDisjoint(firstGeoEntity
, secondGeoEntity
): boolean
Returns true if both geo entities have no overlap
Parameters
Name | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:59
geoDisjointFP
▸ geoDisjointFP(queryGeoEntity
): (input
: unknown
) => boolean
Parameters
Name | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:57
geoIntersects
▸ geoIntersects(firstGeoEntity
, secondGeoEntity
): boolean
Returns true if both geo entities intersect each other, if one of the input geo entity is a point, it will check if the other geo-entity contains the point
Parameters
Name | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:55
geoIntersectsFP
▸ geoIntersectsFP(queryGeoEntity
): (input
: unknown
) => boolean
Parameters
Name | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:56
geoPointWithinRange
▸ geoPointWithinRange(startingPoint
, distanceValue
, point
): boolean
Parameters
Name | Type |
---|---|
startingPoint | GeoPointInput |
distanceValue | string |
point | GeoPointInput |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:23
geoPointWithinRangeFP
▸ geoPointWithinRangeFP(startingPoint
, distanceValue
): (input
: unknown
) => boolean
Parameters
Name | Type |
---|---|
startingPoint | GeoPointInput |
distanceValue | string |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:24
geoPolyHasPoint
▸ geoPolyHasPoint<G
>(polygon
): (fieldData
: unknown
) => boolean
Type parameters
Name | Type | |
---|---|---|
G | extends Polygon \ | MultiPolygon |
Parameters
Name | Type | |
---|---|---|
polygon | G \ | Feature <G , Properties > |
Returns
fn
▸ (fieldData
): boolean
Parameters
Name | Type |
---|---|
fieldData | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:21
geoRelationFP
▸ geoRelationFP(geoShape
, relation
): (input
: unknown
) => boolean
Parameters
Name | Type |
---|---|
geoShape | GeoInput |
relation | GeoShapeRelation |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:25
geoWithin
▸ geoWithin(firstGeoEntity
, secondGeoEntity
): boolean
Returns true if the first geometry is completely within the second geometry. The interiors of both geometries must intersect and, the interior and boundary of the first geometry must not intersect the exterior of the second geometry
Parameters
Name | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:46
geoWithinFP
▸ geoWithinFP(queryGeoEntity
): (input
: unknown
) => boolean
When provided with geoInput that acts as the parent geo-feature, it will return a function that accepts any geoInput and checks to see if the new input is within the parent geo-feature
Parameters
Name | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:51
getBackoffDelay
▸ getBackoffDelay(current
, factor?
, max?
, min?
): number
Get backoff delay that will safe to retry and is slightly staggered
Parameters
Name | Type |
---|---|
current | number |
factor? | number |
max? | number |
min? | number |
Returns
number
Defined in
packages/utils/dist/src/promises.d.ts:78
getCIDRBroadcast
▸ getCIDRBroadcast(input
): string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Defined in
packages/utils/dist/src/ip.d.ts:63
getCIDRMax
▸ getCIDRMax(input
): string
Parameters
Name | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
last ip address in the block
Deprecated
use getLastUsableIPInCIDR
Defined in
packages/utils/dist/src/ip.d.ts:31
getCIDRMin
▸ getCIDRMin(input
): string
Parameters
Name | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
first IP address in the block
Deprecated
use getFirstUsableIPInCIDR
Defined in
packages/utils/dist/src/ip.d.ts:24
getCIDRNetwork
▸ getCIDRNetwork(input
): string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Defined in
packages/utils/dist/src/ip.d.ts:64
getDate
▸ getDate(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:191
getErrorStatusCode
▸ getErrorStatusCode(err
, config?
, defaultCode?
): number
Parameters
Name | Type |
---|---|
err | unknown |
config? | TSErrorConfig |
defaultCode? | number |
Returns
number
Defined in
packages/utils/dist/src/errors.d.ts:132
getField
▸ getField<V
>(input
, field
, defaultVal?
): V
A type safe get function (will always return the correct type)
IMPORTANT This does not behave like lodash.get, it does not deal with dot notation (nested fields) and it will use the default when dealing with OR statements
Type parameters
Name |
---|
V |
Parameters
Name | Type |
---|---|
input | undefined |
field | string |
defaultVal? | V |
Returns
V
Defined in
packages/utils/dist/src/objects.d.ts:50
▸ getField<T
, P
>(input
, field
): T
[P
]
Type parameters
Name | Type | ||
---|---|---|---|
T | T | ||
P | extends string \ | number \ | symbol |
Parameters
Name | Type |
---|---|
input | T |
field | P |
Returns
T
[P
]
Defined in
packages/utils/dist/src/objects.d.ts:51
▸ getField<T
, P
>(input
, field
): T
[P
]
Type parameters
Name | Type | ||
---|---|---|---|
T | T | ||
P | extends string \ | number \ | symbol |
Parameters
Name | Type | |
---|---|---|
input | undefined \ | T |
field | P |
Returns
T
[P
]
Defined in
packages/utils/dist/src/objects.d.ts:52
▸ getField<T
, P
>(input
, field
, defaultVal
): T
[P
]
Type parameters
Name | Type | ||
---|---|---|---|
T | T | ||
P | extends string \ | number \ | symbol |
Parameters
Name | Type | |
---|---|---|
input | undefined \ | T |
field | P | |
defaultVal | never [] |
Returns
T
[P
]
Defined in
packages/utils/dist/src/objects.d.ts:53
▸ getField<T
, P
, V
>(input
, field
, defaultVal
): T
[P
] | V
Type parameters
Name | Type | ||
---|---|---|---|
T | T | ||
P | extends string \ | number \ | symbol |
V | V |
Parameters
Name | Type | |
---|---|---|
input | undefined \ | T |
field | P | |
defaultVal | V |
Returns
T
[P
] | V
Defined in
packages/utils/dist/src/objects.d.ts:54
▸ getField<T
, P
, V
>(input
, field
, defaultVal
): T
[P
]
Type parameters
Name | Type | ||
---|---|---|---|
T | T | ||
P | extends string \ | number \ | symbol |
V | V |
Parameters
Name | Type | |
---|---|---|
input | undefined \ | T |
field | P | |
defaultVal | V |
Returns
T
[P
]
Defined in
packages/utils/dist/src/objects.d.ts:55
getFirst
▸ getFirst<T
>(input
): T
| undefined
If the input is an array it will return the first item else if it will return the input
Type parameters
Name |
---|
T |
Parameters
Name | Type | ||
---|---|---|---|
input | T \ | T [] \ | readonly T [] |
Returns
T
| undefined
Defined in
packages/utils/dist/src/arrays.d.ts:41
getFirstChar
▸ getFirstChar(input
): string
Parameters
Name | Type |
---|---|
input | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:234
getFirstIPInCIDR
▸ getFirstIPInCIDR(input
): string
Parameters
Name | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation, inclusive |
Returns
string
first IP address in the block
Defined in
packages/utils/dist/src/ip.d.ts:37
getFirstKey
▸ getFirstKey<T
>(input
): keyof T
| undefined
Get the first key in an object
Type parameters
Name | Type |
---|---|
T | extends object |
Parameters
Name | Type |
---|---|
input | T |
Returns
keyof T
| undefined
Defined in
packages/utils/dist/src/objects.d.ts:15
getFirstUsableIPInCIDR
▸ getFirstUsableIPInCIDR(input
): string
Parameters
Name | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
first usable ip address of the CIDR block
Defined in
packages/utils/dist/src/ip.d.ts:49
getFirstValue
▸ getFirstValue<T
>(input
): T
| undefined
Get the first value in an object
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
input | Object |
Returns
T
| undefined
Defined in
packages/utils/dist/src/objects.d.ts:9
getFullErrorStack
▸ getFullErrorStack(err
): string
Use following the chain of caused by stack of an error. Don't use this when logging the error, only when sending it
Parameters
Name | Type |
---|---|
err | unknown |
Returns
string
Defined in
packages/utils/dist/src/errors.d.ts:88
getHashCodeFrom
▸ getHashCodeFrom(value
): string
Generate a unique hash code from a value, this is not a guarantee but it is close enough for doing groupBys and caching
Parameters
Name | Type |
---|---|
value | unknown |
Returns
string
Defined in
packages/utils/dist/src/type-coercion.d.ts:31
getHours
▸ getHours(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:189
getLast
▸ getLast<T
>(input
): T
| undefined
If the input is an array it will return the first item else if it will return the input
Type parameters
Name |
---|
T |
Parameters
Name | Type | ||
---|---|---|---|
input | T \ | T [] \ | readonly T [] |
Returns
T
| undefined
Defined in
packages/utils/dist/src/arrays.d.ts:46
getLastIPInCIDR
▸ getLastIPInCIDR(input
): string
Parameters
Name | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
last ip address in the block, inclusive
Defined in
packages/utils/dist/src/ip.d.ts:43
getLastUsableIPInCIDR
▸ getLastUsableIPInCIDR(input
): string
Parameters
Name | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
last usable ip address of the CIDR block
Defined in
packages/utils/dist/src/ip.d.ts:55
getMilliseconds
▸ getMilliseconds(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:184
getMinutes
▸ getMinutes(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:187
getMonth
▸ getMonth(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:193
getSeconds
▸ getSeconds(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:185
getTime
▸ getTime(val?
): number
| false
Ensure unix time
Parameters
Name | Type |
---|---|
val? | DateInputTypes |
Returns
number
| false
Defined in
packages/utils/dist/src/dates.d.ts:52
getTimeBetween
▸ getTimeBetween(input
, args
): string
| number
Parameters
Name | Type |
---|---|
input | unknown |
args | GetTimeBetweenArgs |
Returns
string
| number
Defined in
packages/utils/dist/src/dates.d.ts:124
getTimeBetweenFP
▸ getTimeBetweenFP(args
): (input
: unknown
) => string
| number
A functional version of getTimeBetween
Parameters
Name | Type |
---|---|
args | GetTimeBetweenArgs |
Returns
fn
▸ (input
): string
| number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
| number
Defined in
packages/utils/dist/src/dates.d.ts:128
getTimezoneOffset
▸ getTimezoneOffset(input
, timezone
): number
Given a date and timezone, it will return the offset from UTC in minutes. This is more accurate than timezoneToOffset as it can better account for day lights saving time
Parameters
Name | Type |
---|---|
input | unknown |
timezone | string |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:171
getTimezoneOffsetFP
▸ getTimezoneOffsetFP(timezone
): (input
: unknown
) => number
Given a timezone, it will return a function that will take in dates that will be converted the offset in minutes. This is more accurate than timezoneToOffset as it can better account for day lights saving time
Parameters
Name | Type |
---|---|
timezone | string |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:176
getTypeOf
▸ getTypeOf(val
): string
Determine the type of an input
Parameters
Name | Type |
---|---|
val | any |
Returns
string
a human friendly string that describes the input
Defined in
packages/utils/dist/src/deps.d.ts:25
getUTCDate
▸ getUTCDate(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:190
getUTCHours
▸ getUTCHours(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:188
getUTCMinutes
▸ getUTCMinutes(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:186
getUTCMonth
▸ getUTCMonth(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:192
getUTCYear
▸ getUTCYear(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:194
getUnixTime
▸ getUnixTime(val?
): number
| false
Parameters
Name | Type |
---|---|
val? | DateInputTypes |
Returns
number
| false
Defined in
packages/utils/dist/src/dates.d.ts:53
getValidDate
▸ getValidDate(val
, relativeNow?
): Date
| false
Coerces value into a valid date, returns false if it is invalid. Has added support for converting from date math (i.e. now+1h, now-1m, now+2d/y, 2021-01-01||+2d)
Parameters
Name | Type |
---|---|
val | unknown |
relativeNow? | Date |
Returns
Date
| false
Defined in
packages/utils/dist/src/dates.d.ts:30
getValidDateOrNumberOrThrow
▸ getValidDateOrNumberOrThrow(val
): Date
| number
Returns a valid date or throws, {@see getValidDate}
Parameters
Name | Type |
---|---|
val | unknown |
Returns
Date
| number
Defined in
packages/utils/dist/src/dates.d.ts:49
getValidDateOrThrow
▸ getValidDateOrThrow(val
): Date
Returns a valid date or throws, {@see getValidDate}
Parameters
Name | Type |
---|---|
val | unknown |
Returns
Date
Defined in
packages/utils/dist/src/dates.d.ts:34
getValidDateWithTimezone
▸ getValidDateWithTimezone(val
, getUTC?
): Date
| false
Returns a valid date with the timezone applied {@see getValidDate}
Parameters
Name | Type |
---|---|
val | unknown |
getUTC? | boolean |
Returns
Date
| false
Defined in
packages/utils/dist/src/dates.d.ts:45
getValidDateWithTimezoneOrThrow
▸ getValidDateWithTimezoneOrThrow(val
, getUTC?
): Date
Returns a valid date with the timezone applied or throws{@see getValidDate}
Parameters
Name | Type |
---|---|
val | unknown |
getUTC? | boolean |
Returns
Date
Defined in
packages/utils/dist/src/dates.d.ts:41
getWordParts
▸ getWordParts(input
): string
[]
Split a string and get the word parts
Parameters
Name | Type |
---|---|
input | string |
Returns
string
[]
Defined in
packages/utils/dist/src/strings.d.ts:216
getYear
▸ getYear(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:195
hasOwn
▸ hasOwn(obj
, prop
): boolean
Check if a object has property (and not included in the prototype) Different from has since it doesn't deal with dot notation values.
Parameters
Name | Type | ||
---|---|---|---|
obj | any | ||
prop | string \ | number \ | symbol |
Returns
boolean
Defined in
packages/utils/dist/src/objects.d.ts:60
inGeoBoundingBox
▸ inGeoBoundingBox(top_left
, bottom_right
, point
): boolean
Parameters
Name | Type |
---|---|
top_left | GeoPointInput |
bottom_right | GeoPointInput |
point | GeoPointInput |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:18
inGeoBoundingBoxFP
▸ inGeoBoundingBoxFP(top_left
, bottom_right
): (input
: unknown
) => boolean
Parameters
Name | Type |
---|---|
top_left | GeoPointInput |
bottom_right | GeoPointInput |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:19
inIPRange
▸ inIPRange(input
, args
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
args | Object |
args.cidr? | string |
args.max? | string |
args.min? | string |
Returns
boolean
Defined in
packages/utils/dist/src/ip.d.ts:10
inNumberRange
▸ inNumberRange(input
, args
): input is number
Returns true if number is between min or max value provided
Parameters
Name | Type |
---|---|
input | unknown |
args | InNumberRangeArg |
Returns
input is number
Example
inNumberRange(42, { min: 0, max: 100}); // true
inNumberRange(-42, { min:0 , max: 100 }); // false
inNumberRange(42, { min: 0, max: 42 }); // false
inNumberRange(42, { min: 0, max: 42, inclusive: true }) // true
Defined in
packages/utils/dist/src/numbers.d.ts:55
inNumberRangeFP
▸ inNumberRangeFP(args
): (input
: unknown
) => input is number
Parameters
Name | Type |
---|---|
args | InNumberRangeArg |
Returns
fn
▸ (input
): input is number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is number
Defined in
packages/utils/dist/src/numbers.d.ts:56
includes
▸ includes(input
, key
): boolean
Safely check if an array, object, map, set has a key
Parameters
Name | Type |
---|---|
input | unknown |
key | string |
Returns
boolean
Defined in
packages/utils/dist/src/arrays.d.ts:36
intToIP
▸ intToIP(input
, ipVersion
): string
Parameters
Name | Type | |
---|---|---|
input | unknown | |
ipVersion | string \ | number |
Returns
string
Defined in
packages/utils/dist/src/ip.d.ts:68
ipToInt
▸ ipToInt(input
): bigint
Parameters
Name | Type |
---|---|
input | unknown |
Returns
bigint
Defined in
packages/utils/dist/src/ip.d.ts:67
isAfter
▸ isAfter(input
, date
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
date | DateInputTypes |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:161
isAlpha
▸ isAlpha(input
, locale?
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
locale? | AlphaLocale |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:256
isAlphaNumeric
▸ isAlphaNumeric(input
, locale?
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
locale? | AlphanumericLocale |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:257
isArray
▸ isArray<T
>(input
): input is T
Check if an input is an array, just Array.isArray
Type parameters
Name | Type |
---|---|
T | any [] |
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is T
Defined in
packages/utils/dist/src/arrays.d.ts:50
isArrayLike
▸ isArrayLike<T
>(input
): input is T
Check if an input is an TypedArray or Array instance
Type parameters
Name | Type |
---|---|
T | any [] |
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is T
Defined in
packages/utils/dist/src/arrays.d.ts:59
isAsyncIterator
▸ isAsyncIterator<T
>(input
): input is AsyncIterable<T>
Returns true if the input is an async iterator
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is AsyncIterable<T>
Defined in
packages/utils/dist/src/iterators.d.ts:8
isBase64
▸ isBase64(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:251
isBefore
▸ isBefore(input
, date
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
date | DateInputTypes |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:160
isBetween
▸ isBetween(input
, args
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
args | Object |
args.end | DateInputTypes |
args.start | DateInputTypes |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:162
isBigInt
▸ isBigInt(input
): input is bigint
Check if value is a bigint
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is bigint
Defined in
packages/utils/dist/src/numbers.d.ts:11
isBoolean
▸ isBoolean(input
): input is boolean
Returns true if the input is a boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is boolean
Defined in
packages/utils/dist/src/booleans.d.ts:27
isBooleanLike
▸ isBooleanLike(input
): boolean
Returns true if the input is like a boolean. Use toBoolean to convert it to one.
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Example
isBooleanLike(); // false
isBooleanLike(null); // true
isBooleanLike(0); // true
isBooleanLike('0'); // true
isBooleanLike('false'); // true
isBooleanLike('no'); // true
Defined in
packages/utils/dist/src/booleans.d.ts:41
isBuffer
▸ isBuffer(input
): input is Buffer
Check if an input is an nodejs Buffer
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is Buffer
Defined in
packages/utils/dist/src/buffers.d.ts:9
isCIDR
▸ isCIDR(input
): input is string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is string
Defined in
packages/utils/dist/src/ip.d.ts:17
isCountryCode
▸ isCountryCode(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:253
isDateTuple
▸ isDateTuple(input
): input is DateTuple
Verify if an input is a Date Tuple
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is DateTuple
Defined in
packages/utils/dist/src/dates.d.ts:82
isDeepEqual
▸ isDeepEqual<T
>(target
, input
): input is T
Compares two values and returns a boolean if they are the same. Arrays are compared using original sorting, while object key ordering doesn't matter.
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
target | T |
input | unknown |
Returns
input is T
Example
isDeepEqual({ key1: 1, key2: 2 }, { key2: 2, key1: 1 }) === true;
isDeepEqual(null, null) === true;
isDeepEqual(undefined, undefined) === true;
isDeepEqual(NaN, NaN) === true;
isDeepEqual(3, 3) === true
isDeepEqual('hello', 'hello') === true
isDeepEqual([1, 2, 3], [1, 2, 3]) === true
isDeepEqual([{ some: 'obj' }], [{ some: 'obj' }]) === true
isDeepEqual(undefined, null) === false;
isDeepEqual([1, 2, 3], [1, 3, 2]) === false
isDeepEqual([1, 2, 3], [1, 2, undefined, 3]) === false
isDeepEqual(true, 'true') === false;
Defined in
packages/utils/dist/src/equality.d.ts:33
▸ isDeepEqual<T
>(target
, input
): boolean
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
target | T |
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:34
isDeepEqualFP
▸ isDeepEqualFP<T
>(target
): (input
: unknown
) => input is T
A functional version of isDeepEqual
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
target | T |
Returns
fn
▸ (input
): input is T
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is T
Defined in
packages/utils/dist/src/equality.d.ts:38
▸ isDeepEqualFP<T
>(target
): (input
: unknown
) => boolean
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
target | T |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:39
isElasticsearchError
▸ isElasticsearchError(err
): err is ElasticsearchError
Check is a elasticsearch error
Parameters
Name | Type |
---|---|
err | unknown |
Returns
err is ElasticsearchError
Defined in
packages/utils/dist/src/errors.d.ts:106
isEmail
▸ isEmail(input
): input is string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is string
Defined in
packages/utils/dist/src/strings.d.ts:235
isEmpty
▸ isEmpty<T
>(val?
): val is undefined
Check if an input is empty, similar to lodash.isEmpty
Type parameters
Name |
---|
T |
Parameters
Name | Type | |
---|---|---|
val? | null \ | T |
Returns
val is undefined
Defined in
packages/utils/dist/src/empty.d.ts:5
isEqual
▸ isEqual<T
>(target
, input
): input is T
Verify that two values are the same (uses a reference check). Similar to === except two NaNs is considered the same For deep equality use isDeepEqual
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
target | T |
input | unknown |
Returns
input is T
Defined in
packages/utils/dist/src/equality.d.ts:6
▸ isEqual<T
>(target
, input
): boolean
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
target | T |
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:7
isEqualFP
▸ isEqualFP<T
>(target
): (input
: unknown
) => input is T
A functional version of isEqual
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
target | T |
Returns
fn
▸ (input
): input is T
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is T
Defined in
packages/utils/dist/src/equality.d.ts:11
▸ isEqualFP<T
>(target
): (input
: unknown
) => boolean
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
target | T |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:12
isError
▸ isError(err
): err is Error
Check if an input has an error compatible api
Parameters
Name | Type |
---|---|
err | unknown |
Returns
err is Error
Defined in
packages/utils/dist/src/errors.d.ts:102
isFQDN
▸ isFQDN(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:252
isFalsy
▸ isFalsy(input
): boolean
Returns true if the value is a falsy like value
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/booleans.d.ts:23
isFatalError
▸ isFatalError(err
): boolean
Parameters
Name | Type |
---|---|
err | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/errors.d.ts:99
isFloat
▸ isFloat(val
): val is number
Verify the input is a finite number (and float like)
Parameters
Name | Type |
---|---|
val | unknown |
Returns
val is number
Defined in
packages/utils/dist/src/numbers.d.ts:32
isFriday
▸ isFriday(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:134
isFunction
▸ isFunction(input
): input is Function
Verify an input is a function
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is Function
Defined in
packages/utils/dist/src/functions.d.ts:17
isFuture
▸ isFuture(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:138
isGeoJSON
▸ isGeoJSON(input
): input is GeoShape | ESGeoShape
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is GeoShape | ESGeoShape
Defined in
packages/utils/dist/src/geo.d.ts:4
isGeoPoint
▸ isGeoPoint(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:16
isGeoShapeMultiPolygon
▸ isGeoShapeMultiPolygon(input
): input is GeoShapeMultiPolygon
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is GeoShapeMultiPolygon
Defined in
packages/utils/dist/src/geo.d.ts:7
isGeoShapePoint
▸ isGeoShapePoint(input
): input is GeoShapePoint
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is GeoShapePoint
Defined in
packages/utils/dist/src/geo.d.ts:5
isGeoShapePolygon
▸ isGeoShapePolygon(input
): input is GeoShapePolygon
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is GeoShapePolygon
Defined in
packages/utils/dist/src/geo.d.ts:6
isGreaterThan
▸ isGreaterThan(value
, other
): boolean
Check if a value is greater than another
Parameters
Name | Type |
---|---|
value | unknown |
other | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:55
isGreaterThanFP
▸ isGreaterThanFP(other
): (value
: unknown
) => boolean
Check if a value is greater than or equal to another
Parameters
Name | Type |
---|---|
other | unknown |
Returns
fn
▸ (value
): boolean
Parameters
Name | Type |
---|---|
value | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:59
isGreaterThanOrEqualTo
▸ isGreaterThanOrEqualTo(value
, other
): boolean
Check if a value is greater than or equal to another
Parameters
Name | Type |
---|---|
value | unknown |
other | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:47
isGreaterThanOrEqualToFP
▸ isGreaterThanOrEqualToFP(other
): (value
: unknown
) => boolean
Check if a value is greater than or equal to another
Parameters
Name | Type |
---|---|
other | unknown |
Returns
fn
▸ (value
): boolean
Parameters
Name | Type |
---|---|
value | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:51
isIP
▸ isIP(input
): input is string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is string
Defined in
packages/utils/dist/src/ip.d.ts:1
isIPOrThrow
▸ isIPOrThrow(input
): string
Will throw if input is not a valid IP
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Defined in
packages/utils/dist/src/ip.d.ts:5
isIPRangeOrThrow
▸ isIPRangeOrThrow(input
): string
Will throw if input is not a valid CIDR
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Defined in
packages/utils/dist/src/ip.d.ts:3
isIPv4
▸ isIPv4(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/ip.d.ts:7
isIPv6
▸ isIPv6(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/ip.d.ts:6
isISDN
▸ isISDN(input
, country?
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
country? | string |
Returns
boolean
Defined in
packages/utils/dist/src/phone-number.d.ts:2
isISO8601
▸ isISO8601(input
): input is string
Checks to see if an input is a ISO 8601 date
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is string
Defined in
packages/utils/dist/src/dates.d.ts:65
isInteger
▸ isInteger(val
): val is number
A simplified implementation of lodash isInteger
Parameters
Name | Type |
---|---|
val | unknown |
Returns
val is number
Defined in
packages/utils/dist/src/numbers.d.ts:26
isIterator
▸ isIterator<T
>(input
): input is Iterable<T>
Returns true if the input is an iterator
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is Iterable<T>
Defined in
packages/utils/dist/src/iterators.d.ts:4
isLeapYear
▸ isLeapYear(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:140
isLessThan
▸ isLessThan(value
, other
): boolean
Check if a value is less than another
Parameters
Name | Type |
---|---|
value | unknown |
other | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:71
isLessThanFP
▸ isLessThanFP(other
): (value
: unknown
) => boolean
Check if a value is greater than or equal to another
Parameters
Name | Type |
---|---|
other | unknown |
Returns
fn
▸ (value
): boolean
Parameters
Name | Type |
---|---|
value | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:75
isLessThanOrEqualTo
▸ isLessThanOrEqualTo(value
, other
): boolean
Check if a value is less than or equal to another
Parameters
Name | Type |
---|---|
value | unknown |
other | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:63
isLessThanOrEqualToFP
▸ isLessThanOrEqualToFP(other
): (value
: unknown
) => boolean
Check if a value is less than or equal to another
Parameters
Name | Type |
---|---|
other | unknown |
Returns
fn
▸ (value
): boolean
Parameters
Name | Type |
---|---|
value | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/equality.d.ts:67
isMACAddress
▸ isMACAddress(input
, delimiter?
): input is string
Parameters
Name | Type |
---|---|
input | unknown |
delimiter? | MACDelimiter |
Returns
input is string
Defined in
packages/utils/dist/src/strings.d.ts:236
isMACAddressFP
▸ isMACAddressFP(args?
): (input
: unknown
) => input is string
A functional version of isMacAddress
Parameters
Name | Type |
---|---|
args? | MACDelimiter |
Returns
fn
▸ (input
): input is string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is string
Defined in
packages/utils/dist/src/strings.d.ts:240
isMIMEType
▸ isMIMEType(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:258
isMappedIPv4
▸ isMappedIPv4(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/ip.d.ts:8
isMonday
▸ isMonday(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:130
isNil
▸ isNil<T
>(input
): input is Nil
Type parameters
Name |
---|
T |
Parameters
Name | Type | |
---|---|---|
input | Nil \ | T |
Returns
input is Nil
Defined in
packages/utils/dist/src/empty.d.ts:2
isNonRoutableIP
▸ isNonRoutableIP(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/ip.d.ts:16
isNonZeroCidr
▸ isNonZeroCidr(input
): boolean
Parameters
Name | Type |
---|---|
input | string |
Returns
boolean
Defined in
packages/utils/dist/src/ip.d.ts:66
isNotNil
▸ isNotNil<T
>(input
): boolean
Type parameters
Name |
---|
T |
Parameters
Name | Type | |
---|---|---|
input | T \ | Nil |
Returns
boolean
Defined in
packages/utils/dist/src/empty.d.ts:3
isNumber
▸ isNumber(input
): input is number
Check if an input is a number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is number
Defined in
packages/utils/dist/src/numbers.d.ts:5
isNumberLike
▸ isNumberLike(input
): boolean
A stricter check for verifying a number string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Todo
this needs to be smarter
Defined in
packages/utils/dist/src/numbers.d.ts:24
isObjectEntity
▸ isObjectEntity(input
): boolean
Verify if the input is a object like type
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/objects.d.ts:19
isPast
▸ isPast(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:139
isPhoneNumberLike
▸ isPhoneNumberLike(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/phone-number.d.ts:3
isPlainObject
▸ isPlainObject(input
): boolean
Detect if value is a plain object, that is, an object created by the Object constructor or one via Object.create(null)
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/deps.d.ts:15
isPort
▸ isPort(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:255
isPostalCode
▸ isPostalCode(input
, locale?
): boolean
Parameters
Name | Type | |
---|---|---|
input | unknown | |
locale? | "any" \ | PostalCodeLocale |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:254
isPrimitiveValue
▸ isPrimitiveValue(value
): boolean
Check if a value is a JavaScript primitive value OR it is object with Symbol.toPrimitive
Parameters
Name | Type |
---|---|
value | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:21
isRegExp
▸ isRegExp(input
): input is RegExp
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is RegExp
Defined in
packages/utils/dist/src/regex.d.ts:1
isRegExpLike
▸ isRegExpLike(input
, strict?
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
strict? | boolean |
Returns
boolean
Defined in
packages/utils/dist/src/regex.d.ts:2
isRetryableError
▸ isRetryableError(err
): boolean
Parameters
Name | Type |
---|---|
err | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/errors.d.ts:100
isRoutableIP
▸ isRoutableIP(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/ip.d.ts:15
isSame
▸ isSame<T
>(target
, input
): input is T
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
target | T |
input | unknown |
Returns
input is T
Deprecated
use isDeepEqual instead
Defined in
packages/utils/dist/src/equality.d.ts:33
▸ isSame<T
>(target
, input
): boolean
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
target | T |
input | unknown |
Returns
boolean
Deprecated
use isDeepEqual instead
Defined in
packages/utils/dist/src/equality.d.ts:34
isSaturday
▸ isSaturday(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:135
isSimpleObject
▸ isSimpleObject(input
): input is Record<string, unknown>
Similar to is-plain-object but works better when you cloneDeep a DataEntity
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is Record<string, unknown>
Defined in
packages/utils/dist/src/objects.d.ts:5
isString
▸ isString(val
): val is string
A simplified implementation of lodash isString
Parameters
Name | Type |
---|---|
val | unknown |
Returns
val is string
Defined in
packages/utils/dist/src/strings.d.ts:4
isSunday
▸ isSunday(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:129
isTSError
▸ isTSError(err
): err is TSError
Check is a TSError
Parameters
Name | Type |
---|---|
err | unknown |
Returns
err is TSError
Defined in
packages/utils/dist/src/errors.d.ts:104
isThursday
▸ isThursday(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:133
isToday
▸ isToday(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:142
isTomorrow
▸ isTomorrow(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:141
isTruthy
▸ isTruthy(input
): boolean
Returns true if the value is a truthy like value
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/booleans.d.ts:19
isTuesday
▸ isTuesday(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:131
isTypedArray
▸ isTypedArray<T
>(input
): input is T
Check if an input is an TypedArray instance like: Uint8Array or Uint16Array. This excludes nodejs Buffers since they aren't really the same.
Type parameters
Name | Type |
---|---|
T | TypedArray |
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is T
Defined in
packages/utils/dist/src/arrays.d.ts:55
isURL
▸ isURL(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:241
isUUID
▸ isUUID(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:242
isUnixTime
▸ isUnixTime(input
, allowBefore1970?
): input is number
Checks to see if an input is a unix time
Parameters
Name | Type |
---|---|
input | unknown |
allowBefore1970? | boolean |
Returns
input is number
Defined in
packages/utils/dist/src/dates.d.ts:57
isUnixTimeFP
▸ isUnixTimeFP(allowBefore1970?
): (input
: unknown
) => input is number
A functional version of isUnixTime
Parameters
Name | Type |
---|---|
allowBefore1970? | boolean |
Returns
fn
▸ (input
): input is number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
input is number
Defined in
packages/utils/dist/src/dates.d.ts:61
isValidDate
▸ isValidDate(val
): boolean
A simplified implementation of moment(new Date(val)).isValid()
Parameters
Name | Type |
---|---|
val | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:25
isValidDateInstance
▸ isValidDateInstance(val
): val is Date
Parameters
Name | Type |
---|---|
val | unknown |
Returns
val is Date
Defined in
packages/utils/dist/src/dates.d.ts:50
isValidateNumberType
▸ isValidateNumberType(type
): (input
: unknown
) => boolean
Parameters
Name | Type |
---|---|
type | FieldType |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/numbers.d.ts:85
isWednesday
▸ isWednesday(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:132
isWeekday
▸ isWeekday(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:136
isWeekend
▸ isWeekend(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:137
isWildCardString
▸ isWildCardString(term
): boolean
Parameters
Name | Type |
---|---|
term | string |
Returns
boolean
Defined in
packages/utils/dist/src/regex.d.ts:15
isYesterday
▸ isYesterday(input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/dates.d.ts:143
joinList
▸ joinList(input
, sep?
, join?
): string
Create a sentence from a list (all items will be unique, empty values will be skipped)
Parameters
Name | Type | |
---|---|---|
input | JoinListType [] \ | readonly JoinListType [] |
sep? | string | |
join? | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:268
locked
▸ locked(): (target
: unknown
, propertyKey
: string
, descriptor
: PropertyDescriptor
) => void
A decorator for locking down a method
Returns
fn
▸ (target
, propertyKey
, descriptor
): void
Parameters
Name | Type |
---|---|
target | unknown |
propertyKey | string |
descriptor | PropertyDescriptor |
Returns
void
Defined in
packages/utils/dist/src/decorators.d.ts:2
logError
▸ logError(logger
, err
, ...messages
): void
Safely log an error (with the error first Logger syntax)
Parameters
Name | Type |
---|---|
logger | Logger |
err | unknown |
...messages | any [] |
Returns
void
Defined in
packages/utils/dist/src/errors.d.ts:94
lookup
▸ lookup(input
): (key
: unknown
) => any
Parameters
Name | Type |
---|---|
input | unknown |
Returns
fn
▸ (key
): any
Parameters
Name | Type |
---|---|
key | unknown |
Returns
any
Defined in
packages/utils/dist/src/objects.d.ts:61
lookupTimezone
▸ lookupTimezone(input
): string
Takes in a geo point like entity and returns the timezone of its location
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Defined in
packages/utils/dist/src/geo.d.ts:69
makeCoordinatesFromGeoPoint
▸ makeCoordinatesFromGeoPoint(point
): CoordinateTuple
Parameters
Name | Type |
---|---|
point | GeoPoint |
Returns
CoordinateTuple
Defined in
packages/utils/dist/src/geo.d.ts:20
makeGeoBBox
▸ makeGeoBBox(point1
, point2
): Feature
<Polygon
, Properties
>
Parameters
Name | Type |
---|---|
point1 | GeoPoint |
point2 | GeoPoint |
Returns
Feature
<Polygon
, Properties
>
Defined in
packages/utils/dist/src/geo.d.ts:17
makeGeoCircle
▸ makeGeoCircle(point
, distance
, unitVal?
): Feature
<Polygon
> | undefined
Parameters
Name | Type |
---|---|
point | GeoPoint |
distance | number |
unitVal? | GeoDistanceUnit |
Returns
Feature
<Polygon
> | undefined
Defined in
packages/utils/dist/src/geo.d.ts:22
makeGeoFeature
▸ makeGeoFeature(geoShape
): Feature
<any
> | undefined
Converts a geoJSON object to its turf geo feature counterpart
Parameters
Name | Type |
---|---|
geoShape | unknown |
Returns
Feature
<any
> | undefined
Defined in
packages/utils/dist/src/geo.d.ts:27
makeGeoFeatureOrThrow
▸ makeGeoFeatureOrThrow(geoShape
): Feature
<any
>
Converts a geoJSON object to its turf geo feature counterpart, will throw if not valid
Parameters
Name | Type |
---|---|
geoShape | unknown |
Returns
Feature
<any
>
Defined in
packages/utils/dist/src/geo.d.ts:29
makeISODate
▸ makeISODate(value?
): string
A helper function for making an ISODate string
Parameters
Name | Type | ||||
---|---|---|---|---|---|
value? | null \ | string \ | number \ | Date \ | DateTuple |
Returns
string
Defined in
packages/utils/dist/src/dates.d.ts:23
mapKeys
▸ mapKeys<T
, R
>(input
, fn
): R
Map the keys of an object
Type parameters
Name | Type |
---|---|
T | extends object |
R | T |
Parameters
Name | Type |
---|---|
input | T |
fn | (value : T [keyof T ], key : keyof T ) => any |
Returns
R
Defined in
packages/utils/dist/src/objects.d.ts:33
mapValues
▸ mapValues<T
, R
>(input
, fn
): R
Map the values of an object
Type parameters
Name | Type |
---|---|
T | extends object |
R | T |
Parameters
Name | Type |
---|---|
input | T |
fn | (value : T [keyof T ], key : keyof T ) => any |
Returns
R
Defined in
packages/utils/dist/src/objects.d.ts:31
match
▸ match(regexp
, value
): string
| null
Parameters
Name | Type | |
---|---|---|
regexp | string \ | RegExp |
value | string |
Returns
string
| null
Defined in
packages/utils/dist/src/regex.d.ts:5
matchAll
▸ matchAll(regexp
, value
): string
[] | null
Parameters
Name | Type | |
---|---|---|
regexp | string \ | RegExp |
value | string |
Returns
string
[] | null
Defined in
packages/utils/dist/src/regex.d.ts:10
matchAllFP
▸ matchAllFP(regexp
): (value
: string
) => string
[] | null
A functional version of matchAll
Parameters
Name | Type | |
---|---|---|
regexp | string \ | RegExp |
Returns
fn
▸ (value
): string
[] | null
Parameters
Name | Type |
---|---|
value | string |
Returns
string
[] | null
Defined in
packages/utils/dist/src/regex.d.ts:14
matchFP
▸ matchFP(regexp
): (value
: string
) => string
| null
A functional version of match
Parameters
Name | Type | |
---|---|---|
regexp | string \ | RegExp |
Returns
fn
▸ (value
): string
| null
Parameters
Name | Type |
---|---|
value | string |
Returns
string
| null
Defined in
packages/utils/dist/src/regex.d.ts:9
matchWildcard
▸ matchWildcard(wildCard
, value
): boolean
Parameters
Name | Type |
---|---|
wildCard | string |
value | string |
Returns
boolean
Defined in
packages/utils/dist/src/regex.d.ts:17
md5
▸ md5(value
): string
Parameters
Name | Type | |
---|---|---|
value | string \ | Buffer |
Returns
string
Defined in
packages/utils/dist/src/type-coercion.d.ts:32
memoize
▸ memoize<T
>(fn
): T
A replacement for lodash memoize
Type parameters
Name | Type |
---|---|
T | extends MemoizeFn |
Parameters
Name | Type |
---|---|
fn | T |
Returns
T
Defined in
packages/utils/dist/src/functions.d.ts:15
noop
▸ noop(...args
): any
A simple function that does nothing but return the first argument
Parameters
Name | Type |
---|---|
...args | any [] |
Returns
any
Defined in
packages/utils/dist/src/functions.d.ts:10
not
▸ not<T
>(...fns
): T
Curry one or more functions, where all must returned falsy values
Type parameters
Name | Type |
---|---|
T | extends AnyFn |
Parameters
Name | Type |
---|---|
...fns | T [] |
Returns
T
Defined in
packages/utils/dist/src/fp.d.ts:5
once
▸ once<T
>(fn
): (...args
: ArgType
<T
>) => ReturnType
<T
> | undefined
Creates a function that is only invoked once
Type parameters
Name | Type |
---|---|
T | extends (...args : any []) => any |
Parameters
Name | Type |
---|---|
fn | T |
Returns
fn
▸ (...args
): ReturnType
<T
> | undefined
Parameters
Name | Type |
---|---|
...args | ArgType <T > |
Returns
ReturnType
<T
> | undefined
Defined in
packages/utils/dist/src/functions.d.ts:5
or
▸ or<T
>(...fns
): T
Curry one or more functions, where one must returned a truthy value
Type parameters
Name | Type |
---|---|
T | extends AnyFn |
Parameters
Name | Type |
---|---|
...fns | T [] |
Returns
T
Defined in
packages/utils/dist/src/fp.d.ts:13
pDefer
▸ pDefer(): Object
An alternative to Bluebird.defer: http://bluebirdjs.com/docs/api/deferred-migration.html Considered bad practice in most cases, use the Promise constructor
Returns
Object
Name | Type |
---|---|
promise | Promise <any > |
reject | (reason? : any ) => void |
resolve | (value? : unknown ) => void |
Defined in
packages/utils/dist/src/promises.d.ts:96
pDelay
▸ pDelay<T
>(delay?
, arg?
): Promise
<T
>
promisified setTimeout
Type parameters
Name | Type |
---|---|
T | undefined |
Parameters
Name | Type |
---|---|
delay? | number |
arg? | T |
Returns
Promise
<T
>
Defined in
packages/utils/dist/src/promises.d.ts:2
pImmediate
▸ pImmediate<T
>(arg?
): Promise
<T
>
promisified process.nextTick,setImmediate or setTimeout depending on your environment
Type parameters
Name | Type |
---|---|
T | undefined |
Parameters
Name | Type |
---|---|
arg? | T |
Returns
Promise
<T
>
Defined in
packages/utils/dist/src/promises.d.ts:4
pRace
▸ pRace(promises
, logError?
): Promise
<any
>
Run multiple promises at once, and resolve/reject when the first completes
Parameters
Name | Type |
---|---|
promises | Promise <any >[] |
logError? | (err : any ) => void |
Returns
Promise
<any
>
Defined in
packages/utils/dist/src/promises.d.ts:87
pRaceWithTimeout
▸ pRaceWithTimeout(promises
, timeout
, logError?
): Promise
<any
>
Similar to pRace but with
Parameters
Name | Type | |
---|---|---|
promises | Promise <any > \ | Promise <any >[] |
timeout | number | |
logError? | (err : any ) => void |
Returns
Promise
<any
>
Defined in
packages/utils/dist/src/promises.d.ts:91
pRetry
▸ pRetry<T
>(fn
, options?
): Promise
<T
>
A promise retry fn.
Type parameters
Name | Type |
---|---|
T | any |
Parameters
Name | Type |
---|---|
fn | PromiseFn <T > |
options? | Partial <PRetryConfig > |
Returns
Promise
<T
>
Defined in
packages/utils/dist/src/promises.d.ts:53
pWhile
▸ pWhile(fn
, options?
): Promise
<void
>
Run a function until it returns true or throws an error
Parameters
Name | Type |
---|---|
fn | PromiseFn <any > |
options? | PWhileOptions |
Returns
Promise
<void
>
Defined in
packages/utils/dist/src/promises.d.ts:74
parseCustomDateFormat
▸ parseCustomDateFormat(value
, format
, referenceDate
): number
Parameters
Name | Type |
---|---|
value | unknown |
format | string |
referenceDate | Date |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:95
parseDateValue
▸ parseDateValue(value
, format
, referenceDate
): number
Parse a date value (that has already been validated) and return the epoch millis time.
Parameters
Name | Type | |
---|---|---|
value | unknown | |
format | undefined \ | string |
referenceDate | Date |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:100
parseError
▸ parseError(input
, withStack?
): string
parse input to get error message or stack
Parameters
Name | Type |
---|---|
input | unknown |
withStack? | boolean |
Returns
string
Defined in
packages/utils/dist/src/errors.d.ts:96
parseErrorInfo
▸ parseErrorInfo(input
, config?
): ErrorInfo
parse error for info
Parameters
Name | Type |
---|---|
input | unknown |
config? | TSErrorConfig |
Returns
ErrorInfo
Defined in
packages/utils/dist/src/errors.d.ts:90
parseGeoDistance
▸ parseGeoDistance(str
): GeoDistanceObj
Parameters
Name | Type |
---|---|
str | string |
Returns
GeoDistanceObj
Defined in
packages/utils/dist/src/geo.d.ts:8
parseGeoDistanceUnit
▸ parseGeoDistanceUnit(input
): GeoDistanceUnit
Parameters
Name | Type |
---|---|
input | string |
Returns
GeoDistanceUnit
Defined in
packages/utils/dist/src/geo.d.ts:9
parseGeoPoint
▸ parseGeoPoint(point
): GeoPoint
Convert an input into a Geo Point object with lat and lon
Parameters
Name | Type |
---|---|
point | unknown |
Returns
GeoPoint
Defined in
packages/utils/dist/src/geo.d.ts:13
▸ parseGeoPoint(point
, throwInvalid
): GeoPoint
Parameters
Name | Type |
---|---|
point | unknown |
throwInvalid | true |
Returns
GeoPoint
Defined in
packages/utils/dist/src/geo.d.ts:14
▸ parseGeoPoint(point
, throwInvalid
): GeoPoint
| null
Parameters
Name | Type |
---|---|
point | unknown |
throwInvalid | false |
Returns
GeoPoint
| null
Defined in
packages/utils/dist/src/geo.d.ts:15
parseJSON
▸ parseJSON<T
>(buf
): T
JSON encoded buffer into a json object
Type parameters
Name | Type |
---|---|
T | Record <string , unknown > |
Parameters
Name | Type | |
---|---|---|
buf | string \ | Buffer |
Returns
T
Defined in
packages/utils/dist/src/json.d.ts:4
parseList
▸ parseList(input
): string
[]
Maps an array of strings and and trims the result, or parses a comma separated list and trims the result
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
[]
Defined in
packages/utils/dist/src/strings.d.ts:263
parseNumberList
▸ parseNumberList(input
): number
[]
Like parseList, except it returns numbers
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
[]
Defined in
packages/utils/dist/src/numbers.d.ts:40
parsePhoneNumber
▸ parsePhoneNumber(input
): string
Parameters
Name | Type | |
---|---|---|
input | string \ | number |
Returns
string
Defined in
packages/utils/dist/src/phone-number.d.ts:1
polyHasHoles
▸ polyHasHoles(input
): boolean
Parameters
Name | Type |
---|---|
input | GeoShape |
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:67
prefixErrorMsg
▸ prefixErrorMsg(input
, prefix?
, defaultMsg?
): string
Parameters
Name | Type |
---|---|
input | unknown |
prefix? | string |
defaultMsg? | string |
Returns
string
Defined in
packages/utils/dist/src/errors.d.ts:98
primitiveToString
▸ primitiveToString(value
): string
Convert a JavaScript primitive value to a string. (Does not covert object like entities unless Symbol.toPrimitive is specified)
Parameters
Name | Type |
---|---|
value | unknown |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:26
random
▸ random(min
, max
): number
A native implementation of lodash random
Parameters
Name | Type |
---|---|
min | number |
max | number |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:3
reverseIP
▸ reverseIP(input
): string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Defined in
packages/utils/dist/src/ip.d.ts:69
setDate
▸ setDate(date
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
date | number |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:181
setHours
▸ setHours(hours
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
hours | number |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:180
setMilliseconds
▸ setMilliseconds(ms
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
ms | number |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:177
setMinutes
▸ setMinutes(minutes
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
minutes | number |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:179
setMonth
▸ setMonth(month
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
month | number |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:182
setPrecision
▸ setPrecision(input
, fractionDigits
, truncate?
): number
Returns a truncated number to nth decimal places.
Parameters
Name | Type | Description |
---|---|---|
input | unknown | - |
fractionDigits | number | The number of decimal points to round to. |
truncate? | boolean | If this is true the number will not be rounded |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:63
setPrecisionFP
▸ setPrecisionFP(fractionDigits
, truncate?
): (input
: unknown
) => number
A functional programming version of setPrecision
Parameters
Name | Type | Description |
---|---|---|
fractionDigits | number | The number of decimal points to round to. |
truncate? | boolean | If this is true the number will not be rounded |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:70
setSeconds
▸ setSeconds(seconds
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
seconds | number |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:178
setTimezone
▸ setTimezone(input
, timezone
): DateTuple
Set the timezone offset of a date, returns a date tuple
Parameters
Name | Type | |
---|---|---|
input | unknown | |
timezone | string \ | number |
Returns
DateTuple
Defined in
packages/utils/dist/src/dates.d.ts:74
setTimezoneFP
▸ setTimezoneFP(timezone
): (input
: unknown
) => DateTuple
A curried version of setTimezone
Parameters
Name | Type | |
---|---|---|
timezone | string \ | number |
Returns
fn
▸ (input
): DateTuple
Parameters
Name | Type |
---|---|
input | unknown |
Returns
DateTuple
Defined in
packages/utils/dist/src/dates.d.ts:78
setYear
▸ setYear(year
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
year | number |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:183
shannonEntropy
▸ shannonEntropy(input
): number
Performs a Shannon entropy calculation on string inputs
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/strings.d.ts:271
shortenIPv6Address
▸ shortenIPv6Address(input
): string
Parameters
Name | Type | Description |
---|---|---|
input | unknown | ip address |
Returns
string
IPv6 addresses are returned without leading 0's in a group or empty groups ipv4 addresses are simply returned
Defined in
packages/utils/dist/src/ip.d.ts:62
sort
▸ sort<T
>(arr
, compare?
): T
[]
Sort an arr or set
Type parameters
Name |
---|
T |
Parameters
Name | Type | ||
---|---|---|---|
arr | T [] \ | readonly T [] \ | Set <T > |
compare? | (a : T , b : T ) => number |
Returns
T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:18
sortBy
▸ sortBy<T
, V
>(arr
, fnOrPath
): T
[]
Sort by path or function that returns the values to sort with
Type parameters
Name | Type |
---|---|
T | T |
V | any |
Parameters
Name | Type | |
---|---|---|
arr | T [] \ | Set <T > |
fnOrPath | string \ | (value : T ) => V |
Returns
T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:20
sortKeys
▸ sortKeys<T
>(input
, options?
): T
Sort keys on an object
Type parameters
Name | Type |
---|---|
T | extends Record <string , unknown > |
Parameters
Name | Type |
---|---|
input | T |
options? | Object |
options.deep? | boolean |
Returns
T
Defined in
packages/utils/dist/src/objects.d.ts:27
startsWith
▸ startsWith(str
, val
): boolean
A native implementation of lodash startsWith
Parameters
Name | Type |
---|---|
str | unknown |
val | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:61
startsWithFP
▸ startsWithFP(val
): (input
: unknown
) => boolean
A function version of startsWith
Parameters
Name | Type |
---|---|
val | string |
Returns
fn
▸ (input
): boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/strings.d.ts:63
stringEntropy
▸ stringEntropy(algo?
): StringEntropyFN
returns a function to perform entropy calculations, currently only supports the "shannon" algorithm
Parameters
Name | Type |
---|---|
algo? | shannon |
Returns
Defined in
packages/utils/dist/src/strings.d.ts:278
stripErrorMessage
▸ stripErrorMessage(error
, reason?
, requireSafe?
): string
Parameters
Name | Type |
---|---|
error | unknown |
reason? | string |
requireSafe? | boolean |
Returns
string
Defined in
packages/utils/dist/src/errors.d.ts:133
subtractFromDate
▸ subtractFromDate(input
, args
): number
Parameters
Name | Type |
---|---|
input | unknown |
args | AdjustDateArgs |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:158
subtractFromDateFP
▸ subtractFromDateFP(args
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
args | AdjustDateArgs |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:159
times
▸ times(n
): number
[]
A native implementation of lodash times
Parameters
Name | Type |
---|---|
n | number |
Returns
number
[]
Defined in
packages/utils/dist/src/arrays.d.ts:26
▸ times<T
>(n
, fn
): T
[]
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
n | number |
fn | (index : number ) => T |
Returns
T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:27
timesIter
▸ timesIter(n
): Iterable
<number
>
Like times but an iterable
Parameters
Name | Type |
---|---|
n | number |
Returns
Iterable
<number
>
Defined in
packages/utils/dist/src/arrays.d.ts:29
▸ timesIter<T
>(n
, fn
): Iterable
<T
>
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
n | number |
fn | (index : number ) => T |
Returns
Iterable
<T
>
Defined in
packages/utils/dist/src/arrays.d.ts:30
timezoneToOffset
▸ timezoneToOffset(timezone
): number
Given a timezone, it will return the minutes of its offset from UTC time
Parameters
Name | Type |
---|---|
timezone | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:167
toBigInt
▸ toBigInt(input
): bigint
| false
Convert any input to a bigint
Parameters
Name | Type |
---|---|
input | unknown |
Returns
bigint
| false
Defined in
packages/utils/dist/src/numbers.d.ts:13
toBigIntOrThrow
▸ toBigIntOrThrow(input
): bigint
Convert any input to a bigint
Parameters
Name | Type |
---|---|
input | unknown |
Returns
bigint
Defined in
packages/utils/dist/src/numbers.d.ts:15
toBoolean
▸ toBoolean(input
): boolean
Convert any input into a boolean, this will work with stringified boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Example
toBoolean(1); // true
toBoolean(0); // false
toBoolean('1'); // true
toBoolean('0'); // false
toBoolean('yes'); // true
toBoolean('NO'); // false
toBoolean('true'); // true
toBoolean('FALSE'); // false
Defined in
packages/utils/dist/src/booleans.d.ts:15
toBooleanOrThrow
▸ toBooleanOrThrow(input
): boolean
Will throw if input is not booleanLike, converts input to a Boolean
Parameters
Name | Type |
---|---|
input | unknown |
Returns
boolean
Defined in
packages/utils/dist/src/booleans.d.ts:43
toCIDR
▸ toCIDR(input
, suffix
): string
Parameters
Name | Type | |
---|---|---|
input | unknown | |
suffix | string \ | number |
Returns
string
Defined in
packages/utils/dist/src/ip.d.ts:65
toCamelCase
▸ toCamelCase(input
): string
Parameters
Name | Type |
---|---|
input | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:217
toCelsius
▸ toCelsius(input
): number
Convert a fahrenheit value to celsius, this will return a precision of 2 decimal points
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:75
toEpochMSOrThrow
▸ toEpochMSOrThrow(input
): DateTuple
| number
Will convert a date to its epoch millisecond format or throw if invalid
Parameters
Name | Type |
---|---|
input | unknown |
Returns
DateTuple
| number
Defined in
packages/utils/dist/src/dates.d.ts:197
toFahrenheit
▸ toFahrenheit(input
): number
Convert a celsius value to fahrenheit, this will return a precision of 2 decimal points
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:80
toFloat
▸ toFloat(input
): number
| false
Convert an input to a float, return false if unable to convert input
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
| false
Defined in
packages/utils/dist/src/numbers.d.ts:34
toFloatOrThrow
▸ toFloatOrThrow(input
): number
Convert an input to a float or throw
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:36
toGeoJSON
▸ toGeoJSON(input
): GeoShape
| undefined
Only able to convert geo-points to either a geo-json point or a simple polygon. There is no current support for creating polygon with holes or multi-polygon as of right now. geoJSON input is made sure to be properly formatted for its type value
Parameters
Name | Type |
---|---|
input | unknown |
Returns
GeoShape
| undefined
Defined in
packages/utils/dist/src/geo.d.ts:64
toGeoJSONOrThrow
▸ toGeoJSONOrThrow(input
): GeoShape
Parameters
Name | Type |
---|---|
input | unknown |
Returns
GeoShape
Defined in
packages/utils/dist/src/geo.d.ts:65
toHumanTime
▸ toHumanTime(ms
): string
converts smaller than a week milliseconds to human readable time
Parameters
Name | Type |
---|---|
ms | number |
Returns
string
Defined in
packages/utils/dist/src/dates.d.ts:94
toISO8601
▸ toISO8601(value
): string
Convert a value to an ISO 8601 date string. This should be used over makeISODate
Parameters
Name | Type |
---|---|
value | unknown |
Returns
string
Defined in
packages/utils/dist/src/dates.d.ts:70
toInteger
▸ toInteger(input
): number
| false
Convert an input to a integer, return false if unable to convert input
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
| false
Defined in
packages/utils/dist/src/numbers.d.ts:28
toIntegerOrThrow
▸ toIntegerOrThrow(input
): number
Convert an input to a integer or throw
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:30
toJSONCompatibleValue
▸ toJSONCompatibleValue(input
): any
This will try to convert any BigInt values to a value that is compatible with JSON, it will it will iterate through an array, and check all the keys of an object
Parameters
Name | Type |
---|---|
input | unknown |
Returns
any
Defined in
packages/utils/dist/src/json.d.ts:8
toKebabCase
▸ toKebabCase(input
): string
Parameters
Name | Type |
---|---|
input | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:219
toLowerCase
▸ toLowerCase(input
): string
Converts a value to lower case
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Example
toLowerCase('lowercase'); // 'lowercase'
toLowerCase('MixEd'); // 'mixed'
toLowerCase('UPPERCASE'); // 'uppercase'
Defined in
packages/utils/dist/src/strings.d.ts:57
toNumber
▸ toNumber(input
): number
Convert any input to a number, return Number.NaN if unable to convert input
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:7
toNumberOrThrow
▸ toNumberOrThrow(input
): number
Will throw if converted number is NaN
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:9
toPascalCase
▸ toPascalCase(input
): string
Parameters
Name | Type |
---|---|
input | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:218
toSafeString
▸ toSafeString(input
): string
Make a string url/elasticsearch safe. safeString converts the string to lower case, removes any invalid characters, and replaces whitespace with _ (if it exists in the string) or - Warning this may reduce the str length
Parameters
Name | Type |
---|---|
input | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:229
toSnakeCase
▸ toSnakeCase(input
): string
Parameters
Name | Type |
---|---|
input | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:220
toStatusErrorCode
▸ toStatusErrorCode(input
): string
Parameters
Name | Type | |
---|---|---|
input | undefined \ | string |
Returns
string
Defined in
packages/utils/dist/src/errors.d.ts:97
toString
▸ toString(val
): string
Safely convert any input to a string
Parameters
Name | Type |
---|---|
val | unknown |
Returns
string
Example
toString(1); // '1'
toString(0.01); // '0.01'
toString(true); // 'true'
toString(BigInt(2) ** BigInt(64)); // '18,446,744,073,709,551,616'
toString(new Date('2020-09-23T14:54:21.020Z')) // '2020-09-23T14:54:21.020Z'
Defined in
packages/utils/dist/src/strings.d.ts:16
toTimeZone
▸ toTimeZone(val
, timezone
): DateTuple
| null
Parameters
Name | Type |
---|---|
val | unknown |
timezone | string |
Returns
DateTuple
| null
Defined in
packages/utils/dist/src/dates.d.ts:35
toTimeZoneUsingLocation
▸ toTimeZoneUsingLocation(val
, location
): DateTuple
| null
Parameters
Name | Type |
---|---|
val | unknown |
location | unknown |
Returns
DateTuple
| null
Defined in
packages/utils/dist/src/dates.d.ts:36
toTimeZoneUsingLocationFP
▸ toTimeZoneUsingLocationFP(location
): (val
: unknown
) => DateTuple
| null
Parameters
Name | Type |
---|---|
location | unknown |
Returns
fn
▸ (val
): DateTuple
| null
Parameters
Name | Type |
---|---|
val | unknown |
Returns
DateTuple
| null
Defined in
packages/utils/dist/src/dates.d.ts:37
toTitleCase
▸ toTitleCase(input
): string
Parameters
Name | Type |
---|---|
input | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:221
toUpperCase
▸ toUpperCase(input
): string
Converts a value to upper case
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Example
toUpperCase('lowercase'); // 'LOWERCASE'
toUpperCase('MixEd'); // 'MIXED'
toUpperCase('UPPERCASE'); // 'UPPERCASE'
Defined in
packages/utils/dist/src/strings.d.ts:47
trackTimeout
▸ trackTimeout(timeoutMs
): () => number
| false
track a timeout to see if it expires
Parameters
Name | Type |
---|---|
timeoutMs | number |
Returns
fn
a function that will returns false if the time elapsed
▸ (): number
| false
Returns
number
| false
Defined in
packages/utils/dist/src/dates.d.ts:92
trim
▸ trim(input
, char?
): string
safely trims whitespace from an input
Parameters
Name | Type |
---|---|
input | unknown |
char? | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:28
trimAndToLower
▸ trimAndToLower(input?
): string
safely trim and to lower a input, useful for string comparison
Parameters
Name | Type |
---|---|
input? | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:35
trimAndToUpper
▸ trimAndToUpper(input?
): string
safely trim and to lower a input, useful for string comparison
Parameters
Name | Type |
---|---|
input? | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:37
trimEnd
▸ trimEnd(input
, char?
): string
Parameters
Name | Type |
---|---|
input | unknown |
char? | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:32
trimEndFP
▸ trimEndFP(char?
): (input
: unknown
) => string
Parameters
Name | Type |
---|---|
char? | string |
Returns
fn
▸ (input
): string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:33
trimFP
▸ trimFP(char?
): (input
: unknown
) => string
Parameters
Name | Type |
---|---|
char? | string |
Returns
fn
▸ (input
): string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:29
trimISODateSegment
▸ trimISODateSegment(segment
): (input
: unknown
) => number
Returns a function to trim the ISO 8601 date segment useful for creating yearly, monthly, daily or hourly dates
Parameters
Name | Type |
---|---|
segment | ISO8601DateSegment |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/dates.d.ts:87
trimStart
▸ trimStart(input
, char?
): string
Parameters
Name | Type |
---|---|
input | unknown |
char? | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:30
trimStartFP
▸ trimStartFP(char?
): (input
: unknown
) => string
Parameters
Name | Type |
---|---|
char? | string |
Returns
fn
▸ (input
): string
Parameters
Name | Type |
---|---|
input | unknown |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:31
truncate
▸ truncate(value
, len
, ellipsis?
): string
Truncate a string value, by default it will add an ellipsis (...) if truncated.
Parameters
Name | Type |
---|---|
value | unknown |
len | number |
ellipsis? | boolean |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:71
truncateFP
▸ truncateFP(len
, ellipsis?
): (value
: unknown
) => string
A functional version of truncate
Parameters
Name | Type |
---|---|
len | number |
ellipsis? | boolean |
Returns
fn
▸ (value
): string
Parameters
Name | Type |
---|---|
value | unknown |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:75
tryParseJSON
▸ tryParseJSON<T
>(input
): T
Type parameters
Name | Type |
---|---|
T | any |
Parameters
Name | Type |
---|---|
input | unknown |
Returns
T
Defined in
packages/utils/dist/src/json.d.ts:2
tzCacheLoaded
▸ tzCacheLoaded(): boolean
Returns
boolean
Defined in
packages/utils/dist/src/geo.d.ts:70
unescapeString
▸ unescapeString(str?
): string
Unescape characters in string and avoid double escaping
Parameters
Name | Type |
---|---|
str? | string |
Returns
string
Defined in
packages/utils/dist/src/strings.d.ts:59
uniq
▸ uniq<T
>(arr
): T
[]
A native implementation of lodash uniq
Type parameters
Name |
---|
T |
Parameters
Name | Type | |
---|---|---|
arr | T [] \ | Set <T > |
Returns
T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:16
uniqBy
▸ uniqBy<T
, V
>(values
, fnOrPath
): T
[]
Get the unique values by a path or function that returns the unique values
Type parameters
Name | Type |
---|---|
T | T |
V | any |
Parameters
Name | Type | |
---|---|---|
values | T [] \ | readonly T [] |
fnOrPath | string \ | (value : T ) => V |
Returns
T
[]
Defined in
packages/utils/dist/src/arrays.d.ts:24
validateByteNumber
▸ validateByteNumber(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:81
validateIntegerNumber
▸ validateIntegerNumber(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:83
validateListCoords
▸ validateListCoords(coords
): any
[]
Parameters
Name | Type |
---|---|
coords | CoordinateTuple [] |
Returns
any
[]
Defined in
packages/utils/dist/src/geo.d.ts:66
validateNumberType
▸ validateNumberType(type
): (input
: unknown
) => number
Parameters
Name | Type |
---|---|
type | FieldType |
Returns
fn
▸ (input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:84
validateShortNumber
▸ validateShortNumber(input
): number
Parameters
Name | Type |
---|---|
input | unknown |
Returns
number
Defined in
packages/utils/dist/src/numbers.d.ts:82
waterfall
▸ waterfall(input
, fns
, addBreak?
): Promise
<any
>
Async waterfall function
Parameters
Name | Type |
---|---|
input | unknown |
fns | PromiseFn <any >[] |
addBreak? | boolean |
Returns
Promise
<any
>
Defined in
packages/utils/dist/src/promises.d.ts:83
wildCardToRegex
▸ wildCardToRegex(term
): RegExp
Parameters
Name | Type |
---|---|
term | string |
Returns
RegExp
Defined in
packages/utils/dist/src/regex.d.ts:16
withoutNil
▸ withoutNil<T
>(input
): WithoutNil
<T
>
Build a new object without null or undefined values (shallow)
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
input | T |
Returns
WithoutNil
<T
>
Defined in
packages/utils/dist/src/objects.d.ts:35