mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-14 11:20:20 -06:00
13 lines
246 B
JavaScript
13 lines
246 B
JavaScript
const joi = require('joi')
|
|
|
|
// proxy to joi for option validation
|
|
exports.createSchema = fn => fn(joi)
|
|
|
|
exports.validate = (obj, schema, options = {}) => {
|
|
joi.validate(obj, schema, options, err => {
|
|
if (err) {
|
|
throw err
|
|
}
|
|
})
|
|
}
|