-
Notifications
You must be signed in to change notification settings - Fork 73
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
fix(core): strict function types for http
server types
#44
Conversation
Codecov Report
@@ Coverage Diff @@
## master #44 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 24 24
Lines 291 291
Branches 35 35
=====================================
Hits 291 291
Continue to review full report at Codecov.
|
http
server typeshttp
server types
@@ -35,5 +35,5 @@ export const httpListener = ({ | |||
|
|||
effect$.subscribe(); | |||
|
|||
return (req: HttpRequest, res: HttpResponse) => request$.next({ req, res }); | |||
return (req, res) => request$.next({ req, res }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of strict function types for TS compiler. http.IncomingMessage
does not conform to HttpRequest
which is a wrapper for it.
PR Type
What kind of change does this PR introduce?
What is the current behavior?
HttpRequest
do not match withhttp.IncomingMessage
in strict mode when used withhttp.createServer()
.url
parameter is marked as optional but should be an required parameter because we are usinghttp.server
Issue Number: #43
What is the new behavior?
HttpResponse
andHttpRequest
declarations inhttpListener
handler function.2.9.1
url
toHttpRequest
interface as not optional parameterDoes this PR introduce a breaking change?