1.0.7 • Published 3 years ago

@v-n-b/voi v1.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

Voi

Some minor extensions to Joi in TypeScript

Install

npm install @v-n-b/voi

Browser polyfills

Voi uses ES6 features and Map, so if you support older browsers you might need polyfills.

Usage

import { Voi } from '@v-n-b/voi';

enum Dnd {
    dungeons = 'dungeons',
    dragons = 'dragons',
}

Voi.voi().enum(Action).validate('dungeons');
// Validates

Voi.voi().enum(Status).validate('foo');
// Results in error with type 'voi.enum'

Voi.string().simpleEmail().validate('test@example.com');
// Validates

Voi.string().simpleEmail().validate('testexample.com');
// Results in error with type string.simpleEmail
1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago