Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Aug 15, 2019
1 parent 629d7c5 commit 268e5e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
declare namespace sortKeys {
interface Options {
/**
Recursively sort keys.
Recursively sort keys, including keys of objects inside arrays.
@default false
*/
Expand Down Expand Up @@ -29,13 +29,16 @@ sortKeys({c: 0, a: 0, b: 0});
sortKeys({b: {b: 0, a: 0}, a: 0}, {deep: true});
//=> {a: 0, b: {a: 0, b: 0}}
sortKeys({b: [{b: 0, a: 0}], a: 0}, {deep: true});
//=> {a: 0, b: [{a: 0, b: 0}]}
sortKeys({c: 0, a: 0, b: 0}, {
compare: (a, b) => -a.localeCompare(b)
});
//=> {c: 0, b: 0, a: 0}
```
*/
declare function sortKeys<T extends {[key: string]: unknown}>(
declare function sortKeys<T extends {[key: string]: any}>(
object: T,
options?: sortKeys.Options
): T;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"is-plain-obj": "^2.0.0"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"ava": "^2.2.0",
"tsd": "^0.7.4",
"xo": "^0.24.0"
}
}

0 comments on commit 268e5e3

Please sign in to comment.