flexdinesh / flexdinesh/typy

[Feature] Include custom types in schema validation

Open
#17 0 comments 4 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.