object
Functions
mapValues
mapValues(obj: any, func: (any, string) => any): anyReturn 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:
| Name | Type | Default |
|---|---|---|
| obj | any | |
| func | (any, string) => any |
Returns: any
(source)
mapEntries
mapEntries(obj: any, func: (any, string) => any): anyReturn 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:
| Name | Type | Default |
|---|---|---|
| obj | any | |
| func | (any, string) => any |
Returns: any
(source)
filterEntries
filterEntries(obj: any, func: (any, string) => boolean): anyReturn 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:
| Name | Type | Default |
|---|---|---|
| obj | any | |
| func | (any, string) => boolean |
Returns: any
(source)
everyEntry
everyEntry(obj: any, func: (any, string) => boolean): booleanReturn 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:
| Name | Type | Default |
|---|---|---|
| obj | any | |
| func | (any, string) => boolean |
Returns: boolean
(source)
someEntry
someEntry(obj: any, func: (any, string) => boolean): booleanReturn 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:
| Name | Type | Default |
|---|---|---|
| obj | any | |
| func | (any, string) => boolean |
Returns: boolean
(source)