mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 17:25:21 +00:00
Now isValid for schema validation, prints the message when debug is on;
Added dependency of debug
This commit is contained in:
@@ -66,11 +66,11 @@ module.exports = {
|
||||
locationsDict,
|
||||
transitType
|
||||
},
|
||||
isValid: (opts, schemaName, debug = false) => {
|
||||
isValid: (opts, schemaName) => {
|
||||
let validation = Joi.validate(opts, schemaName);
|
||||
|
||||
if (debug) {
|
||||
console.log(validation)
|
||||
if (validation.error) {
|
||||
debug(`validation failed due to :: ${validation.error.message}`);
|
||||
}
|
||||
|
||||
return !validation.error;
|
||||
|
||||
Reference in New Issue
Block a user