Lint fixes + getting older wrappers using new API correctly

This commit is contained in:
Abhijit Kane
2019-12-18 14:59:13 +05:30
parent 56075c044d
commit bbc7c5e02f
5 changed files with 25 additions and 59 deletions

View File

@@ -5,10 +5,10 @@ const SchemaPack = require('./lib/schemapack.js').SchemaPack;
module.exports = {
// Old API wrapping the new API
convert: function(input, options, cb) {
var schema = new SchemaPack(input);
var schema = new SchemaPack(input, options);
if (schema.validated) {
return schema.convert(options, cb);
return schema.convert(cb);
}
return cb(null, schema.validationResult);