-
-
Notifications
You must be signed in to change notification settings - Fork 455
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
Add option to skip keys with the value of null
in .stringify()
#215
Conversation
Additionally, fix a bug in current stringify behavior: if queryString.stringify({a: [null, 1, undefined, 2, null]}, {
arrayFormat: 'comma'
}
// => `,1,2`, missing `a=` |
What about #196 (comment) ? |
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
which direction are we going? the option should be called |
This |
index.d.ts
Outdated
@@ -192,6 +192,26 @@ export interface StringifyOptions { | |||
``` | |||
*/ | |||
readonly sort?: ((itemLeft: string, itemRight: string) => number) | false; | |||
|
|||
/** | |||
Skip the key in stringify result if value is `null` or `undefined`. |
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.
This makes it sound like it will not skip undefined
by default, which it does.
null
in .stringify()
Follow up on #197 to fix #196.
Closes #197