Skip to content

Commit

Permalink
Improve number API reference on website
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-hiller committed Dec 30, 2023
1 parent 0e56ba3 commit 04bf1df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions website/src/routes/api/(schemas)/number/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,28 @@ With `number` you can validate the data type of the input and with `pipe` you ca

The following examples show how `number` can be used.

### Validate if input is an integer
### Integer schema

Schema that validates if input is an integer
Schema to validate an integer.

```ts
const IntegerSchema = number([integer()]);
```

### Validate range
### Force minimum

Schema that validates a number in a range.
Schema that forces a minimum number of 10.

```ts
const NumberRangeSchema = number([minValue(1), maxValue(100)]);
const MinNumberSchema = number([toMinValue(10)]);
```

### Validate if input is a multiple of 100
### Validate range

Schema that validates if input is a multiple of 100.
Schema that validates a number in a range.

```ts
const MultipleOf100Schema = number([multipleOf(100)]);
const NumberRangeSchema = number([minValue(1), maxValue(100)]);
```

## Related
Expand Down Expand Up @@ -93,7 +93,7 @@ The following APIs can be combined with `number`.

<ApiList
items={[
'equal',
'custom',
'finite',
'integer',
'maxValue',
Expand Down
1 change: 1 addition & 0 deletions website/src/routes/api/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
- [Issues](/api/Issues/)
- [MapPathItem](/api/MapPathItem/)
- [MaybeReadonly](/api/MaybeReadonly/)
- [NumberSchema](/api/NumberSchema/)
- [ObjectPathItem](/api/ObjectPathItem/)
- [OptionalSchema](/api/OptionalSchema/)
- [Output](/api/Output/)
Expand Down

0 comments on commit 04bf1df

Please sign in to comment.