Skip to content

Commit

Permalink
chore: improve listener check
Browse files Browse the repository at this point in the history
  • Loading branch information
tjholm authored Jun 28, 2023
2 parents d0ddcd3 + 9a3b907 commit 7017e2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/resources/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ export const http = (
port: number,
callback?: () => void
) => {
const unknownApp = app as any;

const nodeApp =
app.hasOwnProperty('listen') &&
typeof (app as NodeApplication).listen === 'function'
!!unknownApp.listen && typeof unknownApp.listen === 'function'
? (app as NodeApplication)
: { listen: app as ListenerFunction };

Expand Down

0 comments on commit 7017e2c

Please sign in to comment.