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
- Host: GitHub
- URL: https://github.com/ericadamski/exists-in
- Owner: ericadamski
- License: mit
- Created: 2019-03-05T16:57:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T15:53:58.000Z (over 2 years ago)
- Last Synced: 2025-02-06T09:48:57.428Z (4 months ago)
- Language: JavaScript
- Size: 600 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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!'
```