Module utils/object-utils
Functions
createMergedObject
- createMergedObject<T>(source: T, ...updates: Partial<T>[]): T
-
Type parameters
Parameters
-
source: T
-
Rest ...updates: Partial<T>[]
Returns T
deepCopy
- deepCopy<T>(source: T): T
-
Type parameters
Parameters
Returns T
deepEqual
- deepEqual<T>(objA: T, objB: T): boolean
-
Type parameters
Parameters
Returns boolean
deepFreeze
-
Type parameters
Parameters
Returns T
getNestedProperty
- getNestedProperty(object: any, propertyPath: string | string[], separator?: string): any
-
Parameters
-
object: any
-
propertyPath: string | string[]
-
separator: string = "."
Returns any
getObjectEntries
-
Type parameters
-
T: Record<string, unknown>
Parameters
getOrSetProperty
- getOrSetProperty<S, T>(obj: S, index: T, value: S[T]): S[T]
-
Type parameters
-
S
-
T: string | number | symbol
Parameters
-
obj: S
-
index: T
-
value: S[T]
Returns S[T]
isNotInstance
- isNotInstance<T>(value: T): boolean
-
Type parameters
-
T: Record<string, unknown>
Parameters
Returns boolean
isPlain
- isPlain<T>(object: T): boolean
-
Type parameters
-
T: Record<string, unknown>
Parameters
Returns boolean
makeFlat
- makeFlat<T>(list: T[], propertyPath: string, separator?: string, skipUndefined?: boolean): T[]
-
Type parameters
Parameters
-
list: T[]
-
propertyPath: string
-
separator: string = "."
-
skipUndefined: boolean = false
Returns T[]
roughSizeOfObject
- roughSizeOfObject<T>(object: T): number
-
Type parameters
Parameters
Returns number
setNestedProperty
- setNestedProperty<T>(item: any, key: string | string[], value: T): void
-
Type parameters
Parameters
-
item: any
-
key: string | string[]
-
value: T
Returns void
size
- size<T>(object: T): number
-
Type parameters
-
T: unknown[] | Record<string, unknown>
Parameters
Returns number
toBoolean
- toBoolean<T>(value: T): boolean
-
Type parameters
Parameters
Returns boolean
without
- without<T>(obj: T, items: keyof T[]): Omit<T, any>
-
Type parameters
-
T: Record<string, unknown>
Parameters
Returns Omit<T, any>
Freeze object recursively