Skip to content

Commit

Permalink
docs: clarify error behavior for parameter and array limit
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Harband <[email protected]>
  • Loading branch information
IamLizu and ljharb authored Nov 12, 2024
1 parent b5e89b7 commit fa16d4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ var limited = qs.parse('a=b&c=d', { parameterLimit: 1 });
assert.deepEqual(limited, { a: 'b' });
```

If you want an error to be thrown whenever the parameter limit is exceeded, set the `throwOnLimitExceeded` option to `true`. This option will generate a descriptive error if the query string exceeds the parameterLimit.
If you want an error to be thrown whenever the a limit is exceeded (eg, `parameterLimit`, `arrayLimit`), set the `throwOnLimitExceeded` option to `true`. This option will generate a descriptive error if the query string exceeds a configured limit.
```javascript
try {
qs.parse('a=1&b=2&c=3&d=4', { parameterLimit: 3, throwOnLimitExceeded: true });
Expand Down

0 comments on commit fa16d4a

Please sign in to comment.