Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: readme typos #397

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,15 @@ Parse the value as a boolean type instead of string type if it's a boolean.
Type: `object`\
Default: `{}`

Specify a pre-defined schema to be used when parsing values. The types specified will take precedence over options such as: `parseNumber`, `parseBooleans`, and `arrayFormat`.
Specify a pre-defined schema to be used when parsing values. The types specified will take precedence over options such as: `parseNumbers`, `parseBooleans`, and `arrayFormat`.

Use this feature to override the type of a value. This can be useful when the type is ambiguous such as a phone number.

It is possible to provide a custom function as the parameter type. The parameter's value will equal the function's return value.

Supported Types:

- `'string'`: Parse `phoneNumber` as a string (overriding the `parseNumber` option):
- `'string'`: Parse `phoneNumber` as a string (overriding the `parseNumbers` option):

```js
import queryString from 'query-string';
Expand All @@ -239,7 +239,7 @@ queryString.parse('?phoneNumber=%2B380951234567&id=1', {
//=> {phoneNumber: '+380951234567', id: 1}
```

- `'number'`: Parse `age` as a number (even when `parseNumber` is false):
- `'number'`: Parse `age` as a number (even when `parseNumbers` is false):

```js
import queryString from 'query-string';
Expand All @@ -252,21 +252,21 @@ queryString.parse('?age=20&id=01234&zipcode=90210', {
//=> {age: 20, id: '01234', zipcode: '90210 }
```

- `'string[]'`: Parse `items` as an array of strings (overriding the `parseNumber` option):
- `'string[]'`: Parse `items` as an array of strings (overriding the `parseNumbers` option):

```js
import queryString from 'query-string';

queryString.parse('?age=20&items=1%2C2%2C3', {
parseNumber: true,
parseNumbers: true,
types: {
items: 'string[]',
}
});
//=> {age: 20, items: ['1', '2', '3']}
```

- `'number[]'`: Parse `items` as an array of numbers (even when `parseNumber` is false):
- `'number[]'`: Parse `items` as an array of numbers (even when `parseNumbers` is false):

```js
import queryString from 'query-string';
Expand Down