Skip to content

Commit

Permalink
Document allowDots option for stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSharpieOne committed Jan 17, 2017
1 parent 0adcf3e commit 8bd4c6c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -272,6 +272,20 @@ qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
// 'a=b&a=c'
```

When objects are stringified, by default they use bracket notation:

```javascript
qs.stringify({ a: { b: { c: 'd', e: 'f' } } });
// 'a[b][c]=d&a[b][e]=f'
```

You may override this to use dot notation by setting the `allowDots` option to `true`:

```javascript
qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true });
// 'a.b.c=d&a.b.e=f'
```

Empty strings and null values will omit the value, but the equals sign (=) remains in place:

```javascript
Expand Down

0 comments on commit 8bd4c6c

Please sign in to comment.