Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Improve TS type coverage #677

Merged
merged 1 commit into from
Jul 9, 2020
Merged

Conversation

IvanGoncharov
Copy link
Member

No description provided.

@IvanGoncharov IvanGoncharov added the PR: polish 💅 PR doesn't change public API or any observed behaviour label Jul 8, 2020
src/index.ts Outdated
@@ -466,8 +465,7 @@ export async function getGraphQLParams(
request: Request,
): Promise<GraphQLParams> {
// `url` is always defined for IncomingMessage coming from http.Server
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const urlData = new URLSearchParams(request.url!.split('?')[1]);
const urlData = new URLSearchParams(request.url?.split('?')[1]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request.url should always be defined in the context we're using it, so I'm not sure how the coverage isn't dropping with the use of conditional chaining here :/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielrearden Thanks, corrected Request type to reflect that.

@@ -6,12 +6,9 @@ import querystring from 'querystring';
import getBody from 'raw-body';
import httpError from 'http-errors';
import contentType from 'content-type';
import type { ParsedMediaType } from 'content-type';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dang should have added a FIXME before, thanks

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
PR: polish 💅 PR doesn't change public API or any observed behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants