search-object
v1.2.0
Published
Deep dive into an object to find a given value.
Downloads
1
Maintainers
Readme
search-object
Deep dive into an object to find what your looking for!
Pass it an object and what you want to find.
Installation
$ npm install search-object
Usage
const searchObject = require("search-object");
// OR
import searchObject from "search-object";
const data = {
place: {
with: {
deeply: {
nested: {
data: [
{
city: {
name: "Manchester",
number: 200
}
},
{
city: {
name: "London",
number: 100
}
}
]
}
}
}
}
};
searchObject(data, "London"); // true
searchObject(data, "Manchester"); // true
searchObject(data, 100); // true
searchObject(data, "New York"); // false