@configuration-parsing/validator-joi
v0.8.4-alpha.3
Published
Joi validator for @configuration-parsing/core
Downloads
29
Readme
@configuration-parsing/validator-joi
A joi validator implementing the ValidatableConfiguration
interface of @configuration-parsing/core
.
Install
npm install @configuration-parsing/validator-joi
Documentation
https://botlfux.github.io/configuration-parsing
Usage
import { joiConfigurationValidator } from '@configuration-parser/validator-joi'
import Joi from 'joi'
const parsedConfiguration = {
hello: 'world',
foo: 'bar'
}
const validator = joiConfigurationValidator(Joi.object({
hello: Joi.string().required(),
foo: Joi.string().required()
}))
const parsedConfiguration = await parser.validate(parsedConfiguration)