Skip to content

object

Functions

mapValues

ts
mapValues(obj: any, func: (any, string) => any): any

Return a new object with the same keys, but with each value transformed by the function. The function receives (value, key).

@param obj - The object to transform @param func - The function receiving (value, key)

Parameters:

NameTypeDefault
objany
func(any, string) => any

Returns: any

(source)

mapEntries

ts
mapEntries(obj: any, func: (any, string) => any): any

Return a new object by applying the function to each entry. The function receives (value, key) and should return { key, value }.

@param obj - The object to transform @param func - The function receiving (value, key) returning

Parameters:

NameTypeDefault
objany
func(any, string) => any

Returns: any

(source)

filterEntries

ts
filterEntries(obj: any, func: (any, string) => boolean): any

Return a new object containing only the entries for which the function returns true. The function receives (value, key).

@param obj - The object to filter @param func - The predicate receiving (value, key)

Parameters:

NameTypeDefault
objany
func(any, string) => boolean

Returns: any

(source)

everyEntry

ts
everyEntry(obj: any, func: (any, string) => boolean): boolean

Return true if the function returns true for every entry in the object. The function receives (value, key).

@param obj - The object to test @param func - The predicate receiving (value, key)

Parameters:

NameTypeDefault
objany
func(any, string) => boolean

Returns: boolean

(source)

someEntry

ts
someEntry(obj: any, func: (any, string) => boolean): boolean

Return true if the function returns true for at least one entry in the object. The function receives (value, key).

@param obj - The object to test @param func - The predicate receiving (value, key)

Parameters:

NameTypeDefault
objany
func(any, string) => boolean

Returns: boolean

(source)