Skip to content

Commit

Permalink
Fix and improve symbol API reference on website
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-hiller committed Dec 24, 2023
1 parent e434cdc commit 438061f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
13 changes: 7 additions & 6 deletions website/src/routes/api/(schemas)/symbol/index.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: symbol
description: Creates a symbol schema.
contributors:
- fabian-hiller
- wout-junius
- fabian-hiller
---

import { ApiList, Property } from '~/components';
Expand All @@ -22,7 +23,7 @@ const Schema = symbol(message);

### Explanation

With `symbol` you can validate the data type of the input and with `pipe` you can transform and validate the further details of the bigint. If the input is not a symbol, you can use `message` to customize the error message.
With `symbol` you can validate the data type of the input. If it is not a symbol, you can use `message` to customize the error message.

## Returns

Expand All @@ -32,14 +33,14 @@ With `symbol` you can validate the data type of the input and with `pipe` you ca

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

### Make a Symbol Schema whit custom error message
### Custom message

Symbol schema with a custom error message.

```ts
const schema = symbol('This is not a symbol');
const schema = symbol('A symbol is required');
```

###

## Related

The following APIs can be combined with `symbol`.
Expand Down
12 changes: 5 additions & 7 deletions website/src/routes/api/(types)/SymbolSchema/index.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
title: SymbolSchema
description: String schema type.
description: Symbol schema type.
contributors:
- wout-junius
- fabian-hiller
---

import { Property } from '~/components';

# SymbolSchema

String schema type.
Symbol schema type.

## Definition

Expand All @@ -30,7 +31,7 @@ export const properties = {
{
type: 'custom',
name: 'TOutput',
default: 'string',
default: 'symbol',
},
],
},
Expand All @@ -55,10 +56,7 @@ export const properties = {
type: 'custom',
name: 'Pipe',
href: '../Pipe/',
generics: [{
type: 'custom',
name: 'Symbol',
}],
generics: ['symbol'],
},
'undefined',
],
Expand Down

0 comments on commit 438061f

Please sign in to comment.