Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
meabed committed Jan 15, 2024
1 parent 74ba25c commit 878975a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ index('http://example.com', {
// returns http://example.com?foo=bar&bar=one&bar=two&bar=three
```

if you need the array as an array in the query string, you can pass `disableCSV` as one of this values `'array' | 'order_asc' | 'order_desc'`:
```javascript
index('http://example.com', {
disableCSV: 'array',
queryParams: {
foo: 'bar',
bar: ['one', 'two', 'three']
}
});

// returns http://example.com?foo=bar&bar[]=one&bar[]=two&bar[]=three
```

If you only want the query string, path, hash, or any combination of the three you can skip the URL parameter or pass in an empty string or null:

```javascript
Expand Down

0 comments on commit 878975a

Please sign in to comment.