Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying undefined as the object for .get() and .has() #58

Merged
merged 2 commits into from Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.d.ts
Expand Up @@ -22,11 +22,11 @@ declare const dotProp: {
```
*/
get<T>(
object: {[key: string]: any},
object: {[key: string]: any} | undefined,
path: string
): T | undefined;
get<T>(
object: {[key: string]: any},
object: {[key: string]: any} | undefined,
path: string,
defaultValue: T
): T;
Expand Down Expand Up @@ -72,7 +72,7 @@ declare const dotProp: {
//=> true
```
*/
has(object: {[key: string]: any}, path: string): boolean;
has(object: {[key: string]: any} | undefined, path: string): boolean;

/**
@param object - Object to delete the `path` value.
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Expand Up @@ -77,6 +77,8 @@ Type: `object`

Object to get, set, or delete the `path` value.

You are allowed to pass in `undefined` as the object to the `get` and `has` functions.

#### path

Type: `string`
Expand Down