Skip to content

Commit 294db90

Browse files
committed
[readme] document that addQueryPrefix does not add ? to empty output
Fixes #418
1 parent 5c308e5 commit 294db90

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,12 @@ The query string may optionally be prepended with a question mark:
513513
assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d');
514514
```
515515

516+
Note that when the output is an empty string, the prefix will not be added:
517+
518+
```javascript
519+
assert.equal(qs.stringify({}, { addQueryPrefix: true }), '');
520+
```
521+
516522
The delimiter may be overridden with stringify as well:
517523

518524
```javascript

0 commit comments

Comments
 (0)