Skip to content

Commit

Permalink
Issue #181: Updated readme file - added info about allowSparse option
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Zverev committed Aug 19, 2019
1 parent 44e78a4 commit ed71dd0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -227,6 +227,13 @@ var noSparse = qs.parse('a[1]=b&a[15]=c');
assert.deepEqual(noSparse, { a: ['b', 'c'] });
```

You may also use `allowSparse` option to parse sparse arrays:

```javascript
var sparseArray = qs.parse('a[1]=2&a[3]=5', { allowSparse: true });
assert.deepEqual(sparseArray, { a: [, '2', , '5'] });
```

Note that an empty string is also a value, and will be preserved:

```javascript
Expand Down

0 comments on commit ed71dd0

Please sign in to comment.