shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
findDeep
Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.object
This function take an object and a filter function that will be called for each properties of the object and that will return true or false depending on the property you want to keep or not.
Params
- object*-Object
The object to search in
- filter*-Function
The filter function that take as parameter the property itself, and the property name
Return
- -Object
The searched object
Example
import { findDeep } from '@blackbyte/sugar/object';
findDeep ({
coco: 'hello',
plop: true,
sub: {
property: 'world'
}
}, ({key, item}) => typeof item === 'string');
// {
// coco: 'hello',
// sub: {
// property: 'world'
// }
// }Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space