Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
additionalProperties: false
}
const schema = {
properties: {
app,
api,
server,
schema : type.obj,
mtSchema: type.obj
},
additionalProperties: false
}
const ajv = new Ajv()
AjvKeys(ajv)
const validate = ajv.compile(schema)
const configValidator = config => {
const valid = validate(config)
if (!valid) {
console.log('config errors')
validate.errors.map(printObj)
throw new Error('wrong config fields')
}
}
const canDir = propIs(Function, 'dir', console)
const printObj = canDir
? (arg) => console.dir( arg, { colors: true })
: (arg) => console.log(arg)