Skip to content

Commit

Permalink
Add Typings for prettyPrint with Options (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
lusbuab authored Jul 10, 2021
1 parent e825d32 commit fbe6a95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ declare namespace Router {

reset(): void;
prettyPrint(): string;
prettyPrint(opts: { commonPrefix?: boolean }): string;

all: ShortHandRoute<V>;

Expand Down
2 changes: 2 additions & 0 deletions test/types/router.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ let http2Res!: Http2ServerResponse;

expectType<void>(router.reset())
expectType<string>(router.prettyPrint())
expectType<string>(router.prettyPrint({ commonPrefix: false }))
expectType<string>(router.prettyPrint({ commonPrefix: true }))
}

// HTTP2
Expand Down

0 comments on commit fbe6a95

Please sign in to comment.