[Feature] Include custom types in schema validation
Open
enhancement
help wanted
- Dominant language
- JavaScript
- Stars
- 225
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
Like so:
```js
import { addCustomTypes } from 'typy';
addCustomTypes({
isFirstName: input => 3 <= input.length && input.length <= 15,
isLastName: input => 3 <= input.length && input.length <= 15
});
```
```js
import t, { Schema } from 'typy';
const schema = {
firstName: Schema.isFirstName,
lastName: Schema.isLastName
}
t({
firstName: 'John',
lastName: 'Doe'
}, schema);
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.