Skip to content

Commit

Permalink
Fix TypeScript 3.5 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jun 7, 2019
1 parent 427e12c commit 9c1ef03
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ declare const dotProp: {
//=> 'unicorn'
```
*/
get<T = unknown>(
object: {[key: string]: unknown},
get<T>(
object: {[key: string]: any},
path: string,
defaultValue?: T
): T;
Expand Down Expand Up @@ -50,7 +50,7 @@ declare const dotProp: {
//=> {foo: {bar: 'b', baz: 'x'}}
```
*/
set<T extends {[key: string]: unknown}>(
set<T extends {[key: string]: any}>(
object: T,
path: string,
value: unknown
Expand All @@ -68,10 +68,10 @@ declare const dotProp: {
//=> true
```
*/
has(object: {[key: string]: unknown}, path: string): boolean;
has(object: {[key: string]: any}, path: string): boolean;

/**
@param object Object to delete the `path` value.
@param object - Object to delete the `path` value.
@param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key.
@example
Expand All @@ -89,7 +89,7 @@ declare const dotProp: {
//=> {foo: {bar: {y: 'x'}}}
```
*/
delete(object: {[key: string]: unknown}, path: string): void;
delete(object: {[key: string]: any}, path: string): void;
};

export = dotProp;

0 comments on commit 9c1ef03

Please sign in to comment.