Skip to content

Conversation

@Flarna
Copy link
Contributor

@Flarna Flarna commented Dec 13, 2017

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If changing an existing definition:

Followup on #20720. Try to further improve typing of url.parse() and to avoid reported problems.
@connor4312 @bowdenk7 Please take a look, try in your code and let us know the results. Thanks!

@dt-bot
Copy link
Member

dt-bot commented Dec 13, 2017

types/node/index.d.ts

to authors (@DefinitelyTyped/DefinitelyTyped @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno Microsoft TypeScript (account can't be detected)). Could you review this PR?
👍 or 👎?

@typescript-bot typescript-bot added the Popular package This PR affects a popular package (as counted by NPM download counts). label Dec 13, 2017
@typescript-bot typescript-bot added the Other Approved This PR was reviewed and signed-off by a community member. label Dec 14, 2017
@typescript-bot
Copy link
Contributor

typescript-bot commented Dec 16, 2017

A definition author has approved this PR 👍. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

query: ParsedUrlQuery;
}

export interface UrlStringQuery extends Url {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps rename these types to UrlWith{StringQuery,ParsedQuery} for readability?

// Output of `url.parse`
export interface Url extends UrlObjectCommon {
port?: string;
query?: string | null | ParsedUrlQuery;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe remove this, and make the boolean parse overload return UrlParsedQuery | UrlStringQuery?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems Url.url is used at several other modules so I will keep it.

- Better naming UrlParsedQuery => UrlWithParsedQuery, UrlStringQuery => UrlWithStringQuery
- replace Url type by UrlWithParsedQuery | UrlWithStringQuery
@Flarna
Copy link
Contributor Author

Flarna commented Dec 18, 2017

Thanks for the review. Pushed an update.

@typescript-bot
Copy link
Contributor

@Flarna The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks!

@Flarna
Copy link
Contributor Author

Flarna commented Jan 3, 2018

CI fails unrelated, will try to fix via another PR but it seems fails are introduced faster then I can fix them...

@Flarna
Copy link
Contributor Author

Flarna commented Jan 3, 2018

@mhegazy, @Andy-MS restify fail is unrelated, created #22653 to correct it.
Any chance to get this merged before again some unrelated change breaks build?

@ghost ghost merged commit d9f51ea into DefinitelyTyped:master Jan 3, 2018
@Flarna Flarna deleted the node_url_parse branch January 3, 2018 20:20
KSXGitHub pushed a commit to KSXGitHub/DefinitelyTyped that referenced this pull request May 12, 2018
* tabs to spaces

* [node] improve typing of query.parse()

* Update according to review:
- Better naming UrlParsedQuery => UrlWithParsedQuery, UrlStringQuery => UrlWithStringQuery
- replace Url type by UrlWithParsedQuery | UrlWithStringQuery

* Re-introduce url.Url as it is used by several other modules.
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Other Approved This PR was reviewed and signed-off by a community member. Popular package This PR affects a popular package (as counted by NPM download counts).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants