Skip to main content

Module: utilities/src

Interfaces

References

filterNullAndUndefined

Renames and re-exports filterNullish


filterNullAndUndefinedAndEmpty

Renames and re-exports filterNullishOrEmpty


filterNullAndUndefinedAndZero

Renames and re-exports filterNullishOrZero


isNullOrUndefined

Renames and re-exports isNullish


isNullOrUndefinedOrEmpty

Renames and re-exports isNullishOrEmpty


isNullOrUndefinedOrZero

Renames and re-exports isNullishOrZero

Type Aliases

AbstractConstructor

Ƭ AbstractConstructor<T>: (...args: any[]) => T

Type parameters

Name
T

Type declaration

• (...args)

Parameters
NameType
...argsany[]

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:64


AbstractCtor

Ƭ AbstractCtor<A, R>: (...args: A) => R

Type parameters

NameType
Aextends Arr = readonly any[]
Rany

Type declaration

• (...args)

Parameters
NameType
...argsA

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:54


AnyObject

Ƭ AnyObject<T>: { [K in keyof T]: T[K] }

Type parameters

Name
T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:106


ArgumentTypes

Ƭ ArgumentTypes<F>: F extends (...args: infer A) => any ? A : never

Type parameters

NameType
Fextends (...args: any[]) => unknown

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:38


Arr

Ƭ Private Arr: readonly any[]

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:44


ArrayElementType

Ƭ ArrayElementType<T>: T extends infer K[] ? K : T extends readonly infer RK[] ? RK : T

Type parameters

Name
T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:186


Awaitable

Ƭ Awaitable<T>: PromiseLike<T> | T

Type parameters

Name
T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:79


Builtin

Ƭ Builtin: Primitive | Function | Date | Error | RegExp

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:4


Constructor

Ƭ Constructor<T>: (...args: any[]) => T

Type parameters

Name
T

Type declaration

• (...args)

Parameters
NameType
...argsany[]

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:59


Ctor

Ƭ Ctor<A, R>: (...args: A) => R

Type parameters

NameType
Aextends Arr = readonly any[]
Rany

Type declaration

• (...args)

Parameters
NameType
...argsA

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:49


DeepPartial

Ƭ DeepPartial<T>: { [P in keyof T]?: T[P] extends (infer U)[] ? DeepPartial<U>[] : T[P] extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : DeepPartial<T[P]> }

Type parameters

Name
T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:30


DeepRequired

Ƭ DeepRequired<T>: T extends Builtin ? NonNullable<T> : T extends Map<infer K, infer V> ? Map<DeepRequired<K>, DeepRequired<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<DeepRequired<K>, DeepRequired<V>> : T extends WeakMap<infer K, infer V> ? WeakMap<DeepRequired<K>, DeepRequired<V>> : T extends Set<infer U> ? Set<DeepRequired<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<DeepRequired<U>> : T extends WeakSet<infer U> ? WeakSet<DeepRequired<U>> : T extends Promise<infer U> ? Promise<DeepRequired<U>> : T extends {} ? { [K in keyof T]-?: DeepRequired<T[K]> } : NonNullable<T>

Type parameters

Name
T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:6


FirstArgument

Ƭ FirstArgument<T>: T extends (arg1: infer U, ...args: unknown[]) => unknown ? U : unknown

Type parameters

Name
T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:69


Mutable

Ƭ Mutable<T>: { -readonly [P in keyof T]: T[P] extends unknown[] | NonNullObject ? Mutable<T[P]> : T[P] }

Type parameters

Name
T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:149


NonNullObject

Ƭ NonNullObject: {} & object

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:98


NonNullableProperties

Ƭ NonNullableProperties<T>: { [P in keyof T]: NonNullable<T[P]> }

Type parameters

NameType
Tunknown

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:90


Nullish

Ƭ Nullish: null | undefined

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:84


PartialRequired

Ƭ PartialRequired<T, K>: Partial<Omit<T, K>> & Required<Pick<T, K>>

Type parameters

NameType
TT
Kextends keyof T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:28


PickByValue

Ƭ PickByValue<T, V>: { [P in keyof T]: T[P] extends V ? P : never }[keyof T] & keyof T

Type parameters

Name
T
V

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:127


Primitive

Ƭ Primitive: string | number | boolean | bigint | symbol | undefined | null

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:1


RequiredExcept

Ƭ RequiredExcept<T, K>: Partial<Pick<T, K>> & Required<Omit<T, K>>

Type parameters

NameType
TT
Kextends keyof T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:26


SecondArgument

Ƭ SecondArgument<T>: T extends (arg1: unknown, arg2: infer U, ...args: unknown[]) => unknown ? U : unknown

Type parameters

Name
T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:74


StrictRequired

Ƭ StrictRequired<T>: { [P in keyof T]-?: NonNullable<T[P]> }

Type parameters

Name
T

Defined in

projects/utilities/packages/utilities/src/lib/utilityTypes.ts:172

Functions

arrayStrictEquals

arrayStrictEquals<T>(arr1, arr2): boolean

Type parameters

NameType
Textends readonly unknown[]

Parameters

NameTypeDescription
arr1T
arr2T

Returns

boolean

Defined in

projects/utilities/packages/utilities/src/lib/arrayStrictEquals.ts:6


cast

cast<T>(value): T

Type parameters

Name
T

Parameters

NameTypeDescription
valueunknown

Returns

T

Defined in

projects/utilities/packages/utilities/src/lib/cast.ts:10


chunk

chunk<T>(array, chunkSize): T[][]

Type parameters

Name
T

Parameters

NameTypeDescription
arrayreadonly T[]
chunkSizenumber

Returns

T[][]

Defined in

projects/utilities/packages/utilities/src/lib/chunk.ts:6


classExtends

classExtends<T>(value, base): value is T

Type parameters

NameType
Textends Ctor<readonly any[], any>

Parameters

NameTypeDescription
valueCtor<readonly any[], any>
baseT

Returns

value is T

Defined in

projects/utilities/packages/utilities/src/lib/classExtends.ts:8


codeBlock

codeBlock<T>(language, expression): string

Type parameters

Name
T

Parameters

NameTypeDescription
languagestring
expressionT

Returns

string

Defined in

projects/utilities/packages/utilities/src/lib/codeBlock.ts:8


cutText

cutText(str, length): string

Parameters

NameTypeDescription
strstring
lengthnumber

Returns

string

Defined in

projects/utilities/packages/utilities/src/lib/cutText.ts:10


debounce

debounce<FnArgumentsType, FnReturnType>(func, options?): DebouncedFunc<FnArgumentsType, FnReturnType>

Type parameters

NameType
FnArgumentsTypeextends any[]
FnReturnTypeFnReturnType

Parameters

NameTypeDescription
func(...args: FnArgumentsType) => FnReturnType
optionsDebounceSettings

Returns

DebouncedFunc<FnArgumentsType, FnReturnType>

Defined in

projects/utilities/packages/utilities/src/lib/debounce/index.ts:68


deepClone

deepClone<T>(source): T

Type parameters

Name
T

Parameters

NameTypeDescription
sourceT

Returns

T

Defined in

projects/utilities/packages/utilities/src/lib/deepClone.ts:7


filterNullish

filterNullish<TValue>(value): value is TValue

Type parameters

Name
TValue

Parameters

NameTypeDescription
valueNullish | TValue

Returns

value is TValue

Defined in

projects/utilities/packages/utilities/src/lib/filterNullAndUndefined.ts:19


filterNullishOrEmpty

filterNullishOrEmpty<TValue>(value): value is TValue

Type parameters

Name
TValue

Parameters

NameTypeDescription
value"" | Nullish | TValue

Returns

value is TValue

Defined in

projects/utilities/packages/utilities/src/lib/filterNullAndUndefinedAndEmpty.ts:19


filterNullishOrZero

filterNullishOrZero<TValue>(value): value is TValue

Type parameters

Name
TValue

Parameters

NameTypeDescription
value0 | Nullish | TValue

Returns

value is TValue

Defined in

projects/utilities/packages/utilities/src/lib/filterNullAndUndefinedAndZero.ts:19


hasAtLeastOneKeyInMap

hasAtLeastOneKeyInMap<T>(map, keys): boolean

Type parameters

Name
T

Parameters

NameTypeDescription
mapReadonlyMap<T, any>
keysreadonly T[]

Returns

boolean

Defined in

projects/utilities/packages/utilities/src/lib/hasAtLeastOneKeyInMap.ts:7


inlineCodeBlock

inlineCodeBlock(input): string

Parameters

NameType
inputstring

Returns

string

Defined in

projects/utilities/packages/utilities/src/lib/inlineCodeBlock.ts:7


isClass

isClass(input): input is Ctor<readonly any[], any>

Parameters

NameTypeDescription
inputunknown

Returns

input is Ctor<readonly any[], any>

Defined in

projects/utilities/packages/utilities/src/lib/isClass.ts:7


isFunction

isFunction(input): input is Function

Parameters

NameTypeDescription
inputunknown

Returns

input is Function

Defined in

projects/utilities/packages/utilities/src/lib/isFunction.ts:6


isNullish

isNullish(value): value is Nullish

Parameters

NameTypeDescription
valueunknown

Returns

value is Nullish

Defined in

projects/utilities/packages/utilities/src/lib/isNullOrUndefined.ts:7


isNullishOrEmpty

isNullishOrEmpty(value): value is "" | Nullish

Parameters

NameTypeDescription
valueunknown

Returns

value is "" | Nullish

Defined in

projects/utilities/packages/utilities/src/lib/isNullOrUndefinedOrEmpty.ts:8


isNullishOrZero

isNullishOrZero(value): value is 0 | Nullish

Parameters

NameTypeDescription
valueunknown

Returns

value is 0 | Nullish

Defined in

projects/utilities/packages/utilities/src/lib/isNullOrUndefinedOrZero.ts:8


isNumber

isNumber(input): input is number

Parameters

NameTypeDescription
inputunknown

Returns

input is number

Defined in

projects/utilities/packages/utilities/src/lib/isNumber.ts:5


isObject

isObject(input, constructorType?): input is NonNullObject

Parameters

NameTypeDescription
inputunknown
constructorType?ObjectConstructor

Returns

input is NonNullObject

Defined in

projects/utilities/packages/utilities/src/lib/isObject.ts:8

isObject<T>(input, constructorType): input is InstanceType<T>

Type parameters

NameType
Textends Constructor<unknown>

Parameters

NameType
inputunknown
constructorTypeT

Returns

input is InstanceType<T>

Defined in

projects/utilities/packages/utilities/src/lib/isObject.ts:9


isPrimitive

isPrimitive(input): input is string | number | bigint | boolean

Parameters

NameTypeDescription
inputunknown

Returns

input is string | number | bigint | boolean

Defined in

projects/utilities/packages/utilities/src/lib/isPrimitive.ts:7


isThenable

isThenable(input): input is Thenable

Parameters

NameTypeDescription
inputunknown

Returns

input is Thenable

Defined in

projects/utilities/packages/utilities/src/lib/isThenable.ts:21


makeObject

makeObject(path, value, obj?): Record<string, unknown>

Parameters

NameTypeDescription
pathstring
valueunknown
objRecord<string, unknown>

Returns

Record<string, unknown>

Defined in

projects/utilities/packages/utilities/src/lib/makeObject.ts:7


mergeDefault

mergeDefault<A, B>(base, overwrites?): DeepRequired<A & B>

Type parameters

NameType
Aextends NonNullObject
Bextends Partial<A>

Parameters

NameTypeDescription
baseA
overwrites?B

Returns

DeepRequired<A & B>

Defined in

projects/utilities/packages/utilities/src/lib/mergeDefault.ts:43


mergeObjects

mergeObjects<A, B>(objTarget, objSource): A & B

Type parameters

NameType
Aextends object
Bextends object

Parameters

NameTypeDescription
objTargetA
objSourceReadonly<B>

Returns

A & B

Defined in

projects/utilities/packages/utilities/src/lib/mergeObjects.ts:9


noop

noop(): void

Returns

void

Defined in

projects/utilities/packages/utilities/src/lib/noop.ts:2


objectToTuples

objectToTuples<T>(obj, prefix?): [keyof T, T[keyof T]][]

Type parameters

Name
T

Parameters

NameTypeDefault valueDescription
objAnyObject<T>undefined
prefixstring''

Returns

[keyof T, T[keyof T]][]

Defined in

projects/utilities/packages/utilities/src/lib/objectToTuples.ts:9


parseURL

parseURL(url): URL | null

Parameters

NameTypeDescription
urlstring

Returns

URL | null

Defined in

projects/utilities/packages/utilities/src/lib/parseUrl.ts:7


partition

partition<T>(array, predicate): T[][]

Type parameters

Name
T

Parameters

NameTypeDescription
arrayT[]
predicate(value: T, index: number) => boolean

Returns

T[][]

Defined in

projects/utilities/packages/utilities/src/lib/partition.ts:12


range

range(min, max, step): number[]

Parameters

NameTypeDescription
minnumber
maxnumber
stepnumber

Returns

number[]

Defined in

projects/utilities/packages/utilities/src/lib/range.ts:7


regExpEsc

regExpEsc(str): string

Parameters

NameTypeDescription
strstring

Returns

string

Defined in

projects/utilities/packages/utilities/src/lib/regExpEsc.ts:8


roundNumber

roundNumber(num, scale?): number

Parameters

NameTypeDefault valueDescription
numstring | numberundefined
scalenumber0

Returns

number

Defined in

projects/utilities/packages/utilities/src/lib/roundNumber.ts:7


splitText

splitText(str, length, char?): string

Parameters

NameTypeDefault valueDescription
strstringundefined
lengthnumberundefined
charstring' '

Returns

string

Defined in

projects/utilities/packages/utilities/src/lib/splitText.ts:9


toTitleCase

toTitleCase(str, options?): string

Parameters

NameTypeDescription
strstring
optionsToTitleCaseOptions

Returns

string

Defined in

projects/utilities/packages/utilities/src/lib/toTitleCase.ts:35


tryParse

tryParse(value): object | string

Parameters

NameTypeDescription
valuestring

Returns

object | string

Defined in

projects/utilities/packages/utilities/src/lib/tryParse.ts:6