Skip to content

Conversation

BendingBender
Copy link
Contributor

No description provided.

*
* - `bracket`: stands for parsing correctly arrays with bracket representation on the query string, such as:
*
*
Copy link
Owner

Choose a reason for hiding this comment

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

Why the extra empty line here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

VS Code only renders the following example as code if I add this extra empty line.

An alternative (which I dislike) would be to write it like this:

	 * - `bracket`: stands for parsing correctly arrays with bracket representation on the query string, such as:
	 * 
	 * ```js
  queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'});
  //=> foo: [1,2,3]
```
	 *

Copy link
Owner

Choose a reason for hiding this comment

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

Ah ok. I had a feeling it was something like that.

@sindresorhus sindresorhus merged commit 2c2e77a into sindresorhus:master Mar 3, 2019
@BendingBender BendingBender deleted the typescript-defs branch March 3, 2019 11:40
@Cellule
Copy link

Cellule commented Mar 4, 2019

A little late now, but would have been nice for the definition file to match closer to the version in DefinitelyTyped
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/query-string/index.d.ts
Specifically InputParams vs {[key: string]: unknown} and OutputParams vs ParsedQuery
ParsedUrl is a welcome addition though

@BendingBender
Copy link
Contributor Author

BendingBender commented Mar 4, 2019

This is a necessary evil. This one time we have to break compat with DT.

The benefit is that now types will always be up to date and if a breaking change is introduced to the types, a major version will be released.

In DT, breaking changes to types may be introduced even to patch releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants