Skip to content

Commit

Permalink
[Docs] Fix examples for empty keys parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Coobaha authored and ljharb committed May 21, 2022
1 parent be297d3 commit 5e70a6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ By default, empty keys are omitted after parsing:

```javascript
var obj = qs.parse("=1&=2");
assert.deepEqual(withNull, {});
assert.deepEqual(obj, {});
```

It is possible to include empty keys by using `allowEmptyKeys` flag:

```javascript
var obj = qs.parse("=1&=2", { allowEmptyKeys: true });
assert.deepEqual(withNull, { "": ["1","2"] });
assert.deepEqual(obj, { "": ["1","2"] });
```

### Stringifying
Expand Down

0 comments on commit 5e70a6a

Please sign in to comment.