@terascope/job-components / index
index
Index
Namespaces
Namespace | Description |
---|---|
Logger | - |
Enumerations
Enumeration | Description |
---|---|
DataEncoding | Available data encoding types for a DataEntity |
RecoveryCleanupType | - |
StringEntropy | - |
Classes
Class | Description |
---|---|
BigLRUMap | - |
BigMap | Avoid v8 maximum size for Map by spreading the cache across multiple Maps. This class has the same API as Map but minus more differences in ->set and ->forEach |
BigSet | Avoid v8 maximum size for Set by spreading the cache across multiple Sets. This class has the same API as Set but minus more differences in ->add and ->forEach |
Collector | An in-memory record collector, useful for batch data to a certain size or after a certain amount of time has passed. |
DataEntity | A wrapper for data that can hold additional metadata properties. A DataEntity should be essentially transparent to use within operations. |
EventLoop | A simple class for detecting when the event loop is blocked. The recommend use is to call EventLoop.init(logger) and then await EventLoop.wait() where you want to slow down potentially long running synchronous code |
FlexibleArray | This used to ignore the init size of the array in LRUMap. Doing this will avoid running out of memory at 12 million records. |
Logger | - |
Queue | A basic FIFO queue |
TSError | A custom Error class with additional properties, like statusCode and fatalError |
Interfaces
Interface | Description |
---|---|
APIConfig | APIConfig is the configuration for loading APIs and Observers into a ExecutionContext. |
AnyObject | A simple object with any values |
ConnectionConfig | - |
DataEntityMetadata | DataEntities have conventional metadata properties that can track source, destination and other process information. |
ElasticsearchError | - |
EmptyObject | - |
EncodingConfig | an encoding focused interfaces |
ExecutionConfig | - |
InNumberRangeArg | - |
JobConfig | - |
JobConfigParams | - |
ListOfRecursiveArraysOrValues | A simple definitions of array |
Many | A simple definitions of array |
OpConfig | OpConfig is the configuration that user specifies for a Operation. The only required property is _op since that is used to find the operation. |
PRetryConfig | - |
RecursiveArray | A simple definitions of array |
RouteSenderAPI | Used for sending data to particular index/topic/file/table in a storage system. This is used by the routed sender in the standard-assets |
Slice | A trackable set of work to be preformed by a "Worker" |
SliceAnalyticsData | - |
SliceRequest | The metadata created by the Slicer and ran through a job pipeline |
SysConfig | - |
TSErrorConfig | - |
TSErrorContext | A simple object with any values |
TerafoundationConfig | - |
TerasliceConfig | - |
ValidatedJobConfig | - |
References
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
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
CollectProcessor
Renames and re-exports default
Context
Re-exports Context
ConvictSchema
Renames and re-exports default
CoreOperation
Re-exports CoreOperation
CrossValidationFn
Re-exports CrossValidationFn
DelayProcessor
Renames and re-exports default
EachProcessor
Renames and re-exports default
EventHandlers
Re-exports EventHandlers
ExecutionContext
Re-exports ExecutionContext
ExecutionContextAPI
Re-exports ExecutionContextAPI
ExecutionContextAPIs
Re-exports ExecutionContextAPIs
ExecutionContextConfig
Re-exports ExecutionContextConfig
ExecutionStats
Re-exports ExecutionStats
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
GetClientConfig
Re-exports GetClientConfig
JobAPIInstance
Re-exports JobAPIInstance
JobAPIInstances
Re-exports JobAPIInstances
JobObserver
Renames and re-exports default
JobRunnerAPI
Re-exports JobRunnerAPI
JobValidator
Re-exports JobValidator
LoaderOptions
Re-exports LoaderOptions
MapProcessor
Renames and re-exports default
MetadataFns
Re-exports MetadataFns
MockPromMetrics
Re-exports MockPromMetrics
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
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
RepositoryOperation
Re-exports RepositoryOperation
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
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
TestClientConfig
Re-exports TestClientConfig
TestClients
Re-exports TestClients
TestClientsByEndpoint
Re-exports TestClientsByEndpoint
TestContext
Re-exports TestContext
TestContextAPIs
Re-exports TestContextAPIs
TestContextApis
Re-exports TestContextApis
TestContextOptions
Re-exports TestContextOptions
TestContextType
Re-exports TestContextType
TestReaderFetcher
Renames and re-exports default
TestReaderSlicer
Renames and re-exports default
ValidLoaderOptions
Re-exports ValidLoaderOptions
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
getMetric
Re-exports getMetric
getOpConfig
Re-exports getOpConfig
getOperationAPIType
Re-exports getOperationAPIType
isOperationAPI
Re-exports isOperationAPI
isPromAvailable
Re-exports isPromAvailable
isSlicerExecutionContext
Re-exports isSlicerExecutionContext
isWorkerExecutionContext
Re-exports isWorkerExecutionContext
jobSchema
Re-exports jobSchema
makeContextLogger
Re-exports makeContextLogger
makeExContextLogger
Re-exports makeExContextLogger
makeExecutionContext
Re-exports makeExecutionContext
makeJobSchema
Re-exports makeJobSchema
newTestExecutionConfig
Re-exports newTestExecutionConfig
newTestJobConfig
Re-exports newTestJobConfig
newTestSlice
Re-exports newTestSlice
opSchema
Re-exports opSchema
registerApis
Re-exports registerApis
sliceAnalyticsMetrics
Re-exports sliceAnalyticsMetrics
validateAPIConfig
Re-exports validateAPIConfig
validateJobConfig
Re-exports validateJobConfig
validateOpConfig
Re-exports validateOpConfig
Type Aliases
AdjustDateArgs
AdjustDateArgs:
object
|object
Source
packages/utils/dist/src/dates.d.ts:128
Assignment
Assignment:
"assets_service"
|"cluster_master"
|"node_master"
|"execution_controller"
|"worker"
Source
packages/types/dist/src/teraslice.d.ts:444
ClusterManagerType
ClusterManagerType:
"native"
|"kubernetes"
|"kubernetesV2"
Source
packages/types/dist/src/teraslice.d.ts:4
CreateClientFactoryFn()
CreateClientFactoryFn: (
config
,logger
,options
) =>Promise
<ConnectorOutput
>
Parameters
Parameter | Type |
---|---|
config | Record <string , any > |
logger | Logger |
options | ConnectionConfig |
Returns
Promise
<ConnectorOutput
>
Source
packages/types/dist/src/terafoundation.d.ts:58
DataArrayInput
Source
packages/utils/dist/src/entities/data-entity.d.ts:154
DataEntityMetadataValue<M>
DataEntityMetadataValue<
M
>: keyofDataEntityMetadata
| keyofM
|string
|number
Type parameters
Type parameter |
---|
M |
Source
packages/utils/dist/src/entities/interfaces.d.ts:8
DataInput
DataInput:
Record
<string
,any
> |DataEntity
Source
packages/utils/dist/src/entities/data-entity.d.ts:153
DeadLetterAPIFn()
DeadLetterAPIFn: (
input
,err
) =>void
A supported DeadLetterAPIFn
Parameters
Parameter | Type |
---|---|
input | any |
err | Error |
Returns
void
Source
packages/types/dist/src/teraslice.d.ts:295
DeadLetterAction
DeadLetterAction:
"throw"
|"log"
|"none"
|string
available dead letter queue actions
Source
packages/types/dist/src/teraslice.d.ts:293
Diff<T, U>
Diff<
T
,U
>:T
extendsU
?never
:T
Remove types from T that are assignable to U
Type parameters
Type parameter |
---|
T |
U |
Source
packages/types/dist/src/utility.d.ts:74
EntityMetadataValue<M, K>
EntityMetadataValue<
M
,K
>:K
extends keyofDataEntityMetadata
?DataEntityMetadata
[K
] :K
extends keyofM
?M
[K
] :any
Type parameters
Type parameter |
---|
M |
K |
Source
packages/utils/dist/src/entities/interfaces.d.ts:9
Filter<T, U>
Filter<
T
,U
>:T
extendsU
?T
:never
Remove types from T that are NOT assignable to U
Type parameters
Type parameter |
---|
T |
U |
Source
packages/types/dist/src/utility.d.ts:78
FilteredResult<T, I, E>
FilteredResult<
T
,I
,E
>:{ [P in keyof T]: P extends I ? T[P] : P extends E ? never : T[P] }
Filters the keys of an object (T), by list of included keys (I) and excluded (E)
Type parameters
Type parameter |
---|
T |
I extends keyof T |
E extends keyof T |
Source
packages/types/dist/src/utility.d.ts:86
LifeCycle
LifeCycle:
"once"
|"persistent"
Source
packages/types/dist/src/teraslice.d.ts:178
Nil
Nil:
null
|undefined
Source
packages/types/dist/src/utility.d.ts:43
Omit<T, K>
Omit<
T
,K
>:Pick
<T
,Exclude
<keyofT
,K
>>
Omit the properties available to type. Useful for excluding properties from a type
Example
`Omit<{ a: number, b: number, c: number }, 'b'|'c'> // => { a: 1 }`
Type parameters
Type parameter |
---|
T |
K extends keyof T |
Source
packages/types/dist/src/utility.d.ts:7
Optional<T, K>
Optional<
T
,K
>: { [P in keyof T]: P extends K ? NonNullable<T[P]> | undefined : NonNullable<T[P]> }
Like Partial but makes certain properties optional
Example
`Optional<{ a: number, b: number }, 'b'>`
Type parameters
Type parameter |
---|
T |
K extends keyof T |
Source
packages/types/dist/src/utility.d.ts:40
Override<T1, T2>
Override<
T1
,T2
>:{ [P in keyof T1]: P extends keyof T1 ? T2[P] : T1[P] }
Override specific properties on a type
Example
`Override<{ a: number, b: number }, { b: string }>`
Type parameters
Type parameter |
---|
T1 |
T2 extends { [P in keyof T2]: P extends keyof T1 ? T2[P] : never } |
Source
packages/types/dist/src/utility.d.ts:22
Overwrite<T1, T2>
Overwrite<
T1
,T2
>:{ [P in Exclude<keyof T1, keyof T2>]: T1[P] }
&T2
Overwrite a simple type with different properties. Useful changing and adding additional properties
Example
`Overwrite<{ a: number, b: number }, { b?: number }>`
Type parameters
Type parameter |
---|
T1 |
T2 |
Source
packages/types/dist/src/utility.d.ts:14
PWhileOptions
PWhileOptions:
object
Type declaration
enabledJitter?
optional
enabledJitter:boolean
enable jitter to stagger requests
error?
optional
error:string
error that can be expressed if the timer ends because the function does not return true
maxJitter?
optional
maxJitter:number
the maximum the jitter wait time will be (in milliseconds), defaults to 3x the minJitter setting, but less than timeoutMs
minJitter?
optional
minJitter:number
the minimum the jitter wait time will be (in milliseconds), defaults to 100ms
name?
optional
name:string
Defaults
to "Request"
timeoutMs?
optional
timeoutMs:number
Defaults
to -1 which is never
Source
packages/utils/dist/src/promises.d.ts:54
PartialDeep<T>
PartialDeep<
T
>:{ [P in keyof T]?: PartialDeep<T[P]> }
A deep partial object
Type parameters
Type parameter |
---|
T |
Source
packages/types/dist/src/utility.d.ts:68
Required<T, K>
Required<
T
,K
>: { [P in keyof T]: P extends K ? NonNullable<T[P]> : NonNullable<T[P]> | undefined }
Like Partial but makes certain properties required
Example
`Required<{ a: number, b: number }, 'b'>`
Type parameters
Type parameter |
---|
T |
K extends keyof T |
Source
packages/types/dist/src/utility.d.ts:32
StringEntropyFN()
StringEntropyFN: (
input
) =>number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/strings.d.ts:269
TYPE_ENTITY_METADATA_KEY
TYPE_ENTITY_METADATA_KEY:
"___EntityMetadata"
Source
packages/utils/dist/src/entities/interfaces.d.ts:3
TYPE_IS_DATAENTITY_KEY
TYPE_IS_DATAENTITY_KEY:
"__isDataEntity"
Source
packages/utils/dist/src/entities/interfaces.d.ts:2
Unpacked<T>
Unpacked<
T
>:T
extends infer U[] ?U
:T
extends (...args
) => infer U ?U
:T
extendsPromise
<infer U> ?U
:T
From https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-inference-in-conditional-types
Type parameters
Type parameter |
---|
T |
Source
packages/types/dist/src/utility.d.ts:92
ValueOf<T>
ValueOf<
T
>:T
[keyofT
]
Get the types object (the opposite of keyof)
Type parameters
Type parameter |
---|
T |
Source
packages/types/dist/src/utility.d.ts:82
WithoutNil<T>
WithoutNil<
T
>:{ [P in keyof T]: T[P] extends Nil ? never : T[P] }
Without null or undefined properties
Type parameters
Type parameter |
---|
T |
Source
packages/types/dist/src/utility.d.ts:49
_DataEntityMetadata<M>
_DataEntityMetadata<
M
>:M
&DataEntityMetadata
&AnyObject
Type parameters
Type parameter |
---|
M |
Source
packages/utils/dist/src/entities/interfaces.d.ts:7
_DataEntityMetadataType
_DataEntityMetadataType:
DataEntityMetadata
|AnyObject
Source
packages/utils/dist/src/entities/interfaces.d.ts:6
Variables
LOWER_CASE_CHARS
const
LOWER_CASE_CHARS:object
Type declaration
a
readonly
a:true
b
readonly
b:true
c
readonly
c:true
d
readonly
d:true
e
readonly
e:true
f
readonly
f:true
g
readonly
g:true
h
readonly
h:true
i
readonly
i:true
j
readonly
j:true
k
readonly
k:true
l
readonly
l:true
m
readonly
m:true
n
readonly
n:true
o
readonly
o:true
p
readonly
p:true
q
readonly
q:true
r
readonly
r:true
s
readonly
s:true
t
readonly
t:true
u
readonly
u:true
v
readonly
v:true
w
readonly
w:true
x
readonly
x:true
y
readonly
y:true
z
readonly
z:true
Source
packages/utils/dist/src/strings.d.ts:76
MAX_STRING_LENGTH_BEFORE_MD5
const
MAX_STRING_LENGTH_BEFORE_MD5:1024
=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
Source
packages/utils/dist/src/type-coercion.d.ts:26
NUM_CHARS
const
NUM_CHARS:object
Type declaration
0
readonly
0:true
1
readonly
1:true
2
readonly
2:true
3
readonly
3:true
4
readonly
4:true
5
readonly
5:true
6
readonly
6:true
7
readonly
7:true
8
readonly
8:true
9
readonly
9:true
Source
packages/utils/dist/src/strings.d.ts:132
STATUS_CODES
const
STATUS_CODES:object
Type declaration
100
100:
string
101
101:
string
102
102:
string
103
103:
string
200
200:
string
201
201:
string
202
202:
string
203
203:
string
204
204:
string
205
205:
string
206
206:
string
207
207:
string
208
208:
string
226
226:
string
300
300:
string
301
301:
string
302
302:
string
303
303:
string
304
304:
string
305
305:
string
307
307:
string
308
308:
string
400
400:
string
401
401:
string
402
402:
string
403
403:
string
404
404:
string
405
405:
string
406
406:
string
407
407:
string
408
408:
string
409
409:
string
410
410:
string
411
411:
string
412
412:
string
413
413:
string
414
414:
string
415
415:
string
416
416:
string
417
417:
string
418
418:
string
421
421:
string
422
422:
string
423
423:
string
424
424:
string
425
425:
string
426
426:
string
428
428:
string
429
429:
string
431
431:
string
451
451:
string
500
500:
string
501
501:
string
502
502:
string
503
503:
string
504
504:
string
505
505:
string
506
506:
string
507
507:
string
508
508:
string
509
509:
string
510
510:
string
511
511:
string
Source
packages/utils/dist/src/status-codes.d.ts:1
UPPER_CASE_CHARS
const
UPPER_CASE_CHARS:object
Type declaration
A
readonly
A:true
B
readonly
B:true
C
readonly
C:true
D
readonly
D:true
E
readonly
E:true
F
readonly
F:true
G
readonly
G:true
H
readonly
H:true
I
readonly
I:true
J
readonly
J:true
K
readonly
K:true
L
readonly
L:true
M
readonly
M:true
N
readonly
N:true
O
readonly
O:true
P
readonly
P:true
Q
readonly
Q:true
R
readonly
R:true
S
readonly
S:true
T
readonly
T:true
U
readonly
U:true
V
readonly
V:true
W
readonly
W:true
X
readonly
X:true
Y
readonly
Y:true
Z
readonly
Z:true
Source
packages/utils/dist/src/strings.d.ts:104
WORD_CHARS
const
WORD_CHARS:object
Type declaration
0
readonly
0:true
1
readonly
1:true
2
readonly
2:true
3
readonly
3:true
4
readonly
4:true
5
readonly
5:true
6
readonly
6:true
7
readonly
7:true
8
readonly
8:true
9
readonly
9:true
A
readonly
A:true
B
readonly
B:true
C
readonly
C:true
D
readonly
D:true
E
readonly
E:true
F
readonly
F:true
G
readonly
G:true
H
readonly
H:true
I
readonly
I:true
J
readonly
J:true
K
readonly
K:true
L
readonly
L:true
M
readonly
M:true
N
readonly
N:true
O
readonly
O:true
P
readonly
P:true
Q
readonly
Q:true
R
readonly
R:true
S
readonly
S:true
T
readonly
T:true
U
readonly
U:true
V
readonly
V:true
W
readonly
W:true
X
readonly
X:true
Y
readonly
Y:true
Z
readonly
Z:true
a
readonly
a:true
b
readonly
b:true
c
readonly
c:true
d
readonly
d:true
e
readonly
e:true
f
readonly
f:true
g
readonly
g:true
h
readonly
h:true
i
readonly
i:true
j
readonly
j:true
k
readonly
k:true
l
readonly
l:true
m
readonly
m:true
n
readonly
n:true
o
readonly
o:true
p
readonly
p:true
q
readonly
q:true
r
readonly
r:true
s
readonly
s:true
t
readonly
t:true
u
readonly
u:true
v
readonly
v:true
w
readonly
w:true
x
readonly
x:true
y
readonly
y:true
z
readonly
z:true
Source
packages/utils/dist/src/strings.d.ts:149
WORD_SEPARATOR_CHARS
const
WORD_SEPARATOR_CHARS:object
Type declaration
readonly
** **:true
-
readonly
-:true
_
readonly
_:true
Source
packages/utils/dist/src/strings.d.ts:144
__ENTITY_METADATA_KEY
const
__ENTITY_METADATA_KEY:TYPE_ENTITY_METADATA_KEY
Source
packages/utils/dist/src/entities/interfaces.d.ts:5
__IS_DATAENTITY_KEY
const
__IS_DATAENTITY_KEY:TYPE_IS_DATAENTITY_KEY
Source
packages/utils/dist/src/entities/interfaces.d.ts:4
dataEncodings
const
dataEncodings: readonlyDataEncoding
[]
A list of supported encoding formats
Source
packages/utils/dist/src/entities/interfaces.d.ts:52
geoHash
geoHash:
object
Type declaration
adjacent()
adjacent: (
geoHash
,direction
) =>any
Parameters
Parameter | Type |
---|---|
geoHash | string |
direction | "N" | "S" | "E" | "W" |
Returns
any
bounds()
bounds: (
geoHash
) =>object
Parameters
Parameter | Type |
---|---|
geoHash | string |
Returns
object
ne
ne:
number
sw
sw:
number
decode()
decode: (
geoHash
) =>object
Parameters
Parameter | Type |
---|---|
geoHash | string |
Returns
object
lat
lat:
number
lon
lon:
number
encode()
encode: (
lat
,lon
,precision
?) =>string
encode latitude/longitude point to geohash of given precision (number of characters in resulting geohash); if precision is not specified, it is inferred from precision of latitude/longitude values.
Parameters
Parameter | Type |
---|---|
lat | number |
lon | number |
precision ? | number |
Returns
string
neighbours()
neighbours: (
geoHash
) =>object
Parameters
Parameter | Type |
---|---|
geoHash | string |
Returns
object
n
n:
number
ne
ne:
number
nw
nw:
number
s
s:
number
se
se:
number
sw
sw:
number
w
w:
number
Source
types/latlon-geohash/index.d.ts:34
geoJSONTypes
const
geoJSONTypes:string
[]
Source
packages/utils/dist/src/geo.d.ts:3
getDurationFunc
const
getDurationFunc:object
Type declaration
ISOWeekYears
ISOWeekYears: typeof
differenceInISOWeekYears
businessDays
businessDays: typeof
differenceInBusinessDays
calendarDays
calendarDays: typeof
differenceInCalendarDays
calendarISOWeekYears
calendarISOWeekYears: typeof
differenceInCalendarISOWeekYears
calendarMonths
calendarMonths: typeof
differenceInCalendarMonths
calendarQuarters
calendarQuarters: typeof
differenceInCalendarQuarters
calendarWeeks
calendarWeeks: typeof
differenceInCalendarISOWeeks
calendarYears
calendarYears: typeof
differenceInCalendarYears
days
days: typeof
differenceInDays
hours
hours: typeof
differenceInHours
milliseconds
milliseconds: typeof
differenceInMilliseconds
minutes
minutes: typeof
differenceInMinutes
months
months: typeof
differenceInMonths
quarters
quarters: typeof
differenceInQuarters
seconds
seconds: typeof
differenceInSeconds
weeks
weeks: typeof
differenceInWeeks
years
years: typeof
differenceInYears
Source
packages/utils/dist/src/dates.d.ts:89
isCI
const
isCI:boolean
Source
packages/utils/dist/src/env.d.ts:4
isDev
const
isDev:boolean
Source
packages/utils/dist/src/env.d.ts:3
isProd
const
isProd:boolean
Source
packages/utils/dist/src/env.d.ts:1
isTest
const
isTest:boolean
Source
packages/utils/dist/src/env.d.ts:2
logLevels
const
logLevels:object
Type declaration
debug
debug:
number
error
error:
number
fatal
fatal:
number
info
info:
number
trace
trace:
number
warn
warn:
number
Source
packages/utils/dist/src/logger.d.ts:8
timezoneOffset
const
timezoneOffset:number
Source
packages/utils/dist/src/dates.d.ts:3
Functions
addToDate()
addToDate(
input
,args
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
args | AdjustDateArgs |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:140
addToDateFP()
addToDateFP(
args
): (input
) =>number
Parameters
Parameter | Type |
---|---|
args | AdjustDateArgs |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:141
and()
and<
T
>(...fns
):T
Curry one or more functions, where all must returned truthy values
Type parameters
Type parameter |
---|
T extends AnyFn |
Parameters
Parameter | Type |
---|---|
...fns | T [] |
Returns
T
Source
packages/utils/dist/src/fp.d.ts:9
bigIntToJSON()
bigIntToJSON(
int
):string
|number
Convert a BigInt to either a number or a string
Parameters
Parameter | Type |
---|---|
int | bigint |
Returns
string
| number
Source
packages/utils/dist/src/numbers.d.ts:19
castArray()
castArray<
T
>(input
):T
[]
A simplified implementation of lodash castArray
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
input | undefined | null | T | T [] | readonly T [] |
Returns
T
[]
Source
packages/utils/dist/src/arrays.d.ts:7
chunk()
chunk<
T
>(dataArray
,size
):T
[][]
Chunk an array into specific sizes
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
dataArray | Iterable <T > |
size | number |
Returns
T
[][]
Source
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
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
dataArray | Iterable <T > |
size | number |
Returns
Iterable
<T
[]>
Source
packages/utils/dist/src/arrays.d.ts:34
clone()
clone(
input
):any
Shallow clone an object
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
any
Source
packages/utils/dist/src/deps.d.ts:16
cloneDeep()
cloneDeep<
T
>(input
):T
Type parameters
Type parameter | Value |
---|---|
T | any |
Parameters
Parameter | Type |
---|---|
input | T |
Returns
T
Source
packages/utils/dist/src/deps.d.ts:17
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
Parameter | Type |
---|---|
input | unknown |
Returns
GeoBoundary
Source
packages/utils/dist/src/type-coercion.d.ts:19
coerceToGeoPoint()
coerceToGeoPoint(
input
):GeoPoint
Convert value to a GeoPoint data type
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
GeoPoint
Source
packages/utils/dist/src/type-coercion.d.ts:13
coerceToNumberType()
coerceToNumberType(
type
): (input
) =>number
|bigint
Parameters
Parameter | Type |
---|---|
type | FieldType |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
| bigint
Source
packages/utils/dist/src/type-coercion.d.ts:9
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
Type parameter | Value |
---|---|
T | unknown |
Parameters
Parameter | Type |
---|---|
fieldConfig | DataTypeFieldConfig |
childConfig ? | DataTypeFields |
Returns
CoerceFN
<T
>
Source
packages/utils/dist/src/type-coercion.d.ts:8
concat()
concat(arr, arr1)
concat<
T
>(arr
,arr1
?): readonlyT
[]
Concat and unique the items in the array Any non-array value will be converted to an array
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
arr | T | T [] |
arr1 ? | T | T [] |
Returns
readonly T
[]
Source
packages/utils/dist/src/arrays.d.ts:12
concat(arr, arr1)
concat<
T
>(arr
,arr1
?): readonlyT
[]
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
arr | readonly T [] |
arr1 ? | readonly T [] |
Returns
readonly T
[]
Source
packages/utils/dist/src/arrays.d.ts:13
concat(arr, arr1)
concat<
T
>(arr
,arr1
?): readonlyT
[]
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
arr | readonly T [] |
arr1 ? | T | T [] |
Returns
readonly T
[]
Source
packages/utils/dist/src/arrays.d.ts:14
configurable()
configurable(
value
): (target
,propertyKey
,descriptor
) =>void
A decorator making changing the changing configurable property
Parameters
Parameter | Type |
---|---|
value | boolean |
Returns
Function
Parameters
Parameter | Type |
---|---|
target | unknown |
propertyKey | string |
descriptor | PropertyDescriptor |
Returns
void
Source
packages/utils/dist/src/decorators.d.ts:4
contains()
contains(
input
,substring
):input is string
Check whether a string includes another string
Parameters
Parameter | Type |
---|---|
input | unknown |
substring | string |
Returns
input is string
Source
packages/utils/dist/src/strings.d.ts:246
containsFP()
containsFP(
substring
): (input
) =>input is string
A function version of contains
Parameters
Parameter | Type |
---|---|
substring | string |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is string
Source
packages/utils/dist/src/strings.d.ts:250
debugLogger()
debugLogger(
testName
,param
?,otherName
?):Logger
Parameters
Parameter | Type |
---|---|
testName | string |
param ? | DebugParam |
otherName ? | string |
Returns
Source
packages/utils/dist/src/logger.d.ts:16
endsWith()
endsWith(
str
,val
):boolean
A native implementation of lodash endsWith
Parameters
Parameter | Type |
---|---|
str | unknown |
val | unknown |
Returns
boolean
Source
packages/utils/dist/src/strings.d.ts:65
endsWithFP()
endsWithFP(
val
): (input
) =>boolean
A function version of startsWith
Parameters
Parameter | Type |
---|---|
val | string |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
packages/utils/dist/src/strings.d.ts:67
ensureBuffer()
ensureBuffer(
input
,encoding
?):Buffer
Convert an input to a Buffer if possible
Parameters
Parameter | Type |
---|---|
input | string | Buffer |
encoding ? | BufferEncoding |
Returns
Buffer
Source
packages/utils/dist/src/buffers.d.ts:6
enumerable()
enumerable(
enabled
?): (target
,propertyKey
,descriptor
) =>void
A decorator for making a method enumerable or none-enumerable
Parameters
Parameter | Type |
---|---|
enabled ? | boolean |
Returns
Function
Parameters
Parameter | Type |
---|---|
target | unknown |
propertyKey | string |
descriptor | PropertyDescriptor |
Returns
void
Source
packages/utils/dist/src/decorators.d.ts:6
escapeString()
escapeString(
input
):string
Escape characters in string and avoid double escaping
Parameters
Parameter | Type |
---|---|
input | string | number |
Returns
string
Source
packages/utils/dist/src/deps.d.ts:24
extractMappedIPv4()
extractMappedIPv4(
input
):string
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
Source
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
Type parameter |
---|
T extends object |
U extends object |
Parameters
Parameter | Type |
---|---|
target | T |
source | U |
Returns
T
& U
Source
packages/utils/dist/src/objects.d.ts:29
fastCloneDeep()
fastCloneDeep<
T
>(input
):T
A clone deep using JSON.parse(JSON.stringify(input))
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
input | T |
Returns
T
Source
packages/utils/dist/src/objects.d.ts:27
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
Type parameter |
---|
T extends object |
I extends string | number | symbol |
E extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
data | T |
by ? | object |
by.excludes ? | E [] |
by.includes ? | I [] |
Returns
FilteredResult
<T
, I
, E
>
Source
packages/utils/dist/src/objects.d.ts:43
firstToLower()
firstToLower(
str
):string
Change first character in string to lower case
Parameters
Parameter | Type |
---|---|
str | string |
Returns
string
Source
packages/utils/dist/src/strings.d.ts:233
firstToUpper()
firstToUpper(
str
):string
Change first character in string to upper case
Parameters
Parameter | Type |
---|---|
str | string |
Returns
string
Source
packages/utils/dist/src/strings.d.ts:231
flatten()
flatten<
T
>(val
):T
[]
A native implementation of lodash flatten
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
val | Many <T []> |
Returns
T
[]
Source
packages/utils/dist/src/arrays.d.ts:4
flattenDeep()
flattenDeep<
T
>(val
):T
[]
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
val | ListOfRecursiveArraysOrValues <T > |
Returns
T
[]
Source
packages/utils/dist/src/arrays.d.ts:5
formatDateValue()
formatDateValue(
value
,format
):string
|number
Format the parsed date value
Parameters
Parameter | Type |
---|---|
value | number | Date | DateTuple |
format | undefined | string |
Returns
string
| number
Source
packages/utils/dist/src/dates.d.ts:88
formatRegex()
formatRegex(
input
,flags
?):RegExp
Parameters
Parameter | Type |
---|---|
input | string | RegExp |
flags ? | RegexFlag [] |
Returns
RegExp
Source
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
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:35
geoContainsFP()
geoContainsFP(
queryGeoEntity
): (input
) =>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
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:40
geoDisjoint()
geoDisjoint(
firstGeoEntity
,secondGeoEntity
):boolean
Returns true if both geo entities have no overlap
Parameters
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:59
geoDisjointFP()
geoDisjointFP(
queryGeoEntity
): (input
) =>boolean
Parameters
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
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
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:55
geoIntersectsFP()
geoIntersectsFP(
queryGeoEntity
): (input
) =>boolean
Parameters
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:56
geoPointWithinRange()
geoPointWithinRange(
startingPoint
,distanceValue
,point
):boolean
Parameters
Parameter | Type |
---|---|
startingPoint | GeoPointInput |
distanceValue | string |
point | GeoPointInput |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:23
geoPointWithinRangeFP()
geoPointWithinRangeFP(
startingPoint
,distanceValue
): (input
) =>boolean
Parameters
Parameter | Type |
---|---|
startingPoint | GeoPointInput |
distanceValue | string |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:24
geoPolyHasPoint()
geoPolyHasPoint<
G
>(polygon
): (fieldData
) =>boolean
Type parameters
Type parameter |
---|
G extends Polygon | MultiPolygon |
Parameters
Parameter | Type |
---|---|
polygon | G | Feature <G , GeoJsonProperties > |
Returns
Function
Parameters
Parameter | Type |
---|---|
fieldData | unknown |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:21
geoRelationFP()
geoRelationFP(
geoShape
,relation
): (input
) =>boolean
Parameters
Parameter | Type |
---|---|
geoShape | GeoInput |
relation | GeoShapeRelation |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
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
Parameter | Type |
---|---|
firstGeoEntity | GeoInput |
secondGeoEntity | GeoInput |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:46
geoWithinFP()
geoWithinFP(
queryGeoEntity
): (input
) =>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
Parameter | Type |
---|---|
queryGeoEntity | GeoInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
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
Parameter | Type |
---|---|
current | number |
factor ? | number |
max ? | number |
min ? | number |
Returns
number
Source
packages/utils/dist/src/promises.d.ts:78
getCIDRBroadcast()
getCIDRBroadcast(
input
):string
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
Source
packages/utils/dist/src/ip.d.ts:63
getCIDRMax()
getCIDRMax(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
last ip address in the block
Deprecated
use getLastUsableIPInCIDR
Source
packages/utils/dist/src/ip.d.ts:31
getCIDRMin()
getCIDRMin(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
first IP address in the block
Deprecated
use getFirstUsableIPInCIDR
Source
packages/utils/dist/src/ip.d.ts:24
getCIDRNetwork()
getCIDRNetwork(
input
):string
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
Source
packages/utils/dist/src/ip.d.ts:64
getDate()
getDate(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:175
getErrorStatusCode()
getErrorStatusCode(
err
,config
?,defaultCode
?):number
Parameters
Parameter | Type |
---|---|
err | unknown |
config ? | TSErrorConfig |
defaultCode ? | number |
Returns
number
Source
packages/utils/dist/src/errors.d.ts:132
getField()
getField(input, field, defaultVal)
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
Type parameter |
---|
V |
Parameters
Parameter | Type |
---|---|
input | undefined |
field | string |
defaultVal ? | V |
Returns
V
Source
packages/utils/dist/src/objects.d.ts:54
getField(input, field)
getField<
T
,P
>(input
,field
):T
[P
]
Type parameters
Type parameter |
---|
T |
P extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
input | T |
field | P |
Returns
T
[P
]
Source
packages/utils/dist/src/objects.d.ts:55
getField(input, field)
getField<
T
,P
>(input
,field
):T
[P
]
Type parameters
Type parameter |
---|
T |
P extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
input | undefined | T |
field | P |
Returns
T
[P
]
Source
packages/utils/dist/src/objects.d.ts:56
getField(input, field, defaultVal)
getField<
T
,P
>(input
,field
,defaultVal
):T
[P
]
Type parameters
Type parameter |
---|
T |
P extends string | number | symbol |
Parameters
Parameter | Type |
---|---|
input | undefined | T |
field | P |
defaultVal | never [] |
Returns
T
[P
]
Source
packages/utils/dist/src/objects.d.ts:57
getField(input, field, defaultVal)
getField<
T
,P
,V
>(input
,field
,defaultVal
):T
[P
] |V
Type parameters
Type parameter |
---|
T |
P extends string | number | symbol |
V |
Parameters
Parameter | Type |
---|---|
input | undefined | T |
field | P |
defaultVal | V |
Returns
T
[P
] | V
Source
packages/utils/dist/src/objects.d.ts:58
getField(input, field, defaultVal)
getField<
T
,P
,V
>(input
,field
,defaultVal
):T
[P
]
Type parameters
Type parameter |
---|
T |
P extends string | number | symbol |
V |
Parameters
Parameter | Type |
---|---|
input | undefined | T |
field | P |
defaultVal | V |
Returns
T
[P
]
Source
packages/utils/dist/src/objects.d.ts:59
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
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
input | T | T [] | readonly T [] |
Returns
T
| undefined
Source
packages/utils/dist/src/arrays.d.ts:41
getFirstChar()
getFirstChar(
input
):string
Parameters
Parameter | Type |
---|---|
input | string |
Returns
string
Source
packages/utils/dist/src/strings.d.ts:234
getFirstIPInCIDR()
getFirstIPInCIDR(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation, inclusive |
Returns
string
first IP address in the block
Source
packages/utils/dist/src/ip.d.ts:37
getFirstKey()
getFirstKey<
T
>(input
): keyofT
|undefined
Get the first key in an object
Type parameters
Type parameter |
---|
T extends object |
Parameters
Parameter | Type |
---|---|
input | T |
Returns
keyof T
| undefined
Source
packages/utils/dist/src/objects.d.ts:15
getFirstUsableIPInCIDR()
getFirstUsableIPInCIDR(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
first usable ip address of the CIDR block
Source
packages/utils/dist/src/ip.d.ts:49
getFirstValue()
getFirstValue<
T
>(input
):T
|undefined
Get the first value in an object
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
input | object |
Returns
T
| undefined
Source
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
Parameter | Type |
---|---|
err | unknown |
Returns
string
Source
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
Parameter | Type |
---|---|
value | unknown |
Returns
string
Source
packages/utils/dist/src/type-coercion.d.ts:32
getHours()
getHours(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:173
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
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
input | T | T [] | readonly T [] |
Returns
T
| undefined
Source
packages/utils/dist/src/arrays.d.ts:46
getLastIPInCIDR()
getLastIPInCIDR(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
last ip address in the block, inclusive
Source
packages/utils/dist/src/ip.d.ts:43
getLastUsableIPInCIDR()
getLastUsableIPInCIDR(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
last usable ip address of the CIDR block
Source
packages/utils/dist/src/ip.d.ts:55
getMilliseconds()
getMilliseconds(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:168
getMinutes()
getMinutes(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:171
getMonth()
getMonth(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:177
getSeconds()
getSeconds(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:169
getTime()
getTime(
val
?):number
|false
Ensure unix time
Parameters
Parameter | Type |
---|---|
val ? | DateInputTypes |
Returns
number
| false
Source
packages/utils/dist/src/dates.d.ts:36
getTimeBetween()
getTimeBetween(
input
,args
):string
|number
Parameters
Parameter | Type |
---|---|
input | unknown |
args | GetTimeBetweenArgs |
Returns
string
| number
Source
packages/utils/dist/src/dates.d.ts:108
getTimeBetweenFP()
getTimeBetweenFP(
args
): (input
) =>string
|number
A functional version of getTimeBetween
Parameters
Parameter | Type |
---|---|
args | GetTimeBetweenArgs |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
| number
Source
packages/utils/dist/src/dates.d.ts:112
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
Parameter | Type |
---|---|
input | unknown |
timezone | string |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:155
getTimezoneOffsetFP()
getTimezoneOffsetFP(
timezone
): (input
) =>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
Parameter | Type |
---|---|
timezone | string |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:160
getTypeOf()
getTypeOf(
val
):string
Determine the type of an input
Parameters
Parameter | Type |
---|---|
val | any |
Returns
string
a human friendly string that describes the input
Source
packages/utils/dist/src/deps.d.ts:22
getUTCDate()
getUTCDate(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:174
getUTCHours()
getUTCHours(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:172
getUTCMinutes()
getUTCMinutes(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:170
getUTCMonth()
getUTCMonth(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:176
getUTCYear()
getUTCYear(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:178
getUnixTime()
getUnixTime(
val
?):number
|false
Parameters
Parameter | Type |
---|---|
val ? | DateInputTypes |
Returns
number
| false
Source
packages/utils/dist/src/dates.d.ts:37
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
Parameter | Type |
---|---|
val | unknown |
relativeNow ? | Date |
Returns
Date
| false
Source
packages/utils/dist/src/dates.d.ts:14
getValidDateOrNumberOrThrow()
getValidDateOrNumberOrThrow(
val
):Date
|number
Returns a valid date or throws, {@see getValidDate}
Parameters
Parameter | Type |
---|---|
val | unknown |
Returns
Date
| number
Source
packages/utils/dist/src/dates.d.ts:33
getValidDateOrThrow()
getValidDateOrThrow(
val
):Date
Returns a valid date or throws, {@see getValidDate}
Parameters
Parameter | Type |
---|---|
val | unknown |
Returns
Date
Source
packages/utils/dist/src/dates.d.ts:18
getValidDateWithTimezone()
getValidDateWithTimezone(
val
,getUTC
?):Date
|false
Returns a valid date with the timezone applied {@see getValidDate}
Parameters
Parameter | Type |
---|---|
val | unknown |
getUTC ? | boolean |
Returns
Date
| false
Source
packages/utils/dist/src/dates.d.ts:29
getValidDateWithTimezoneOrThrow()
getValidDateWithTimezoneOrThrow(
val
,getUTC
?):Date
Returns a valid date with the timezone applied or throws{@see getValidDate}
Parameters
Parameter | Type |
---|---|
val | unknown |
getUTC ? | boolean |
Returns
Date
Source
packages/utils/dist/src/dates.d.ts:25
getWordParts()
getWordParts(
input
):string
[]
Split a string and get the word parts
Parameters
Parameter | Type |
---|---|
input | string |
Returns
string
[]
Source
packages/utils/dist/src/strings.d.ts:216
getYear()
getYear(
input
):number
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
number
Source
packages/utils/dist/src/dates.d.ts:179
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
Parameter | Type |
---|---|
obj | any |
prop | string | number | symbol |
Returns
boolean
Source
packages/utils/dist/src/objects.d.ts:64
inGeoBoundingBox()
inGeoBoundingBox(
top_left
,bottom_right
,point
):boolean
Parameters
Parameter | Type |
---|---|
top_left | GeoPointInput |
bottom_right | GeoPointInput |
point | GeoPointInput |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:18
inGeoBoundingBoxFP()
inGeoBoundingBoxFP(
top_left
,bottom_right
): (input
) =>boolean
Parameters
Parameter | Type |
---|---|
top_left | GeoPointInput |
bottom_right | GeoPointInput |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
packages/utils/dist/src/geo.d.ts:19
inIPRange()
inIPRange(
input
,args
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
args | object |
args.cidr ? | string |
args.max ? | string |
args.min ? | string |
Returns
boolean
Source
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
Parameter | 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
Source
packages/utils/dist/src/numbers.d.ts:55
inNumberRangeFP()
inNumberRangeFP(
args
): (input
) =>input is number
Parameters
Parameter | Type |
---|---|
args | InNumberRangeArg |
Returns
Function
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is number
Source
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
Parameter | Type |
---|---|
input | unknown |
key | string |
Returns
boolean
Source
packages/utils/dist/src/arrays.d.ts:36
intToIP()
intToIP(
input
,ipVersion
):string
Parameters
Parameter | Type |
---|---|
input | unknown |
ipVersion | string | number |
Returns
string
Source
packages/utils/dist/src/ip.d.ts:68
ipToInt()
ipToInt(
input
):bigint
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
bigint
Source
packages/utils/dist/src/ip.d.ts:67
isAfter()
isAfter(
input
,date
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
date | DateInputTypes |
Returns
boolean
Source
packages/utils/dist/src/dates.d.ts:145
isAlpha()
isAlpha(
input
,locale
?):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
locale ? | AlphaLocale |
Returns
boolean
Source
packages/utils/dist/src/strings.d.ts:256
isAlphaNumeric()
isAlphaNumeric(
input
,locale
?):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
locale ? | AlphanumericLocale |
Returns
boolean
Source
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
Type parameter | Value |
---|---|
T | any [] |
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is T
Source
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
Type parameter | Value |
---|---|
T | any [] |
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is T
Source
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
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is AsyncIterable<T>
Source
packages/utils/dist/src/iterators.d.ts:8
isBase64()
isBase64(
input
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
packages/utils/dist/src/strings.d.ts:251
isBefore()
isBefore(
input
,date
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
date | DateInputTypes |
Returns
boolean
Source
packages/utils/dist/src/dates.d.ts:144
isBetween()
isBetween(
input
,args
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
args | object |
args.end | DateInputTypes |
args.start | DateInputTypes |
Returns
boolean
Source
packages/utils/dist/src/dates.d.ts:146
isBigInt()
isBigInt(
input
):input is bigint
Check if value is a bigint
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is bigint
Source
packages/utils/dist/src/numbers.d.ts:11
isBoolean()
isBoolean(
input
):input is boolean
Returns true if the input is a boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is boolean
Source
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
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Example
isBooleanLike(); // false
isBooleanLike(null); // true
isBooleanLike(0); // true
isBooleanLike('0'); // true
isBooleanLike('false'); // true
isBooleanLike('no'); // true
Source
packages/utils/dist/src/booleans.d.ts:41
isBuffer()
isBuffer(
input
):input is Buffer
Check if an input is an nodejs Buffer
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is Buffer
Source
packages/utils/dist/src/buffers.d.ts:10
isCIDR()
isCIDR(
input
):input is string
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is string
Source
packages/utils/dist/src/ip.d.ts:17
isCountryCode()
isCountryCode(
input
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
packages/utils/dist/src/strings.d.ts:253
isDateTuple()
isDateTuple(
input
):input is DateTuple
Verify if an input is a Date Tuple
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is DateTuple
Source
packages/utils/dist/src/dates.d.ts:66
isDeepEqual()
isDeepEqual(target, input)
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
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
target | T |
input | unknown |