An open API service indexing awesome lists of open source software.

https://github.com/ericadamski/exists-in

Checks an object to see if the given property exists
https://github.com/ericadamski/exists-in

Last synced: 3 months ago
JSON representation

Checks an object to see if the given property exists

Awesome Lists containing this project

README

        

# exists-in

Checks an object to see if the given property exists

## Install

```
yarn add exists-in
```

## Usage

```javascript
const existsIn = require("exists-in");

existsIn("a.b.c", {
a: {
b: {
c: "hooray!",
},
},
});
// > 'hooray!'

existsIn(
"a.b.c.d",
{
a: {
b: {
c: "hooray!",
},
},
},
"oops!" // Pass a default fallback option to return if the value does not exist
);
// > 'oops!'
```