Skip to content

Commit

Permalink
Amended type-defination of url-parser (#3696)
Browse files Browse the repository at this point in the history
  • Loading branch information
awasthishubh authored and AndrewSouthpaw committed Jan 16, 2020
1 parent 2cbbfd7 commit 6feb760
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare module 'url-parse' {
hostname: string,
port: string,
pathname: string,
query: Object,
query: { [key: string]: string },
hash: string,
href: string,
origin: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare module 'url-parse' {
hostname: string,
port: string,
pathname: string,
query: Object,
query: { [key: string]: string },
hash: string,
href: string,
origin: string,
Expand Down
4 changes: 3 additions & 1 deletion definitions/npm/url-parse_v1.3.x/test_url-parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ const pathname: string = url.pathname;
const pathname2: number = url.pathname;

const query: Object = url.query;
const query2: { [key: string]: string } = url.query;

// $ExpectError number. This type is incompatible with Object
const query2: number = url.query;
const query3: number = url.query;

const hash: string = url.hash;
// $ExpectError number. This type is incompatible with boolean
Expand Down

0 comments on commit 6feb760

Please sign in to comment.