Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -104,6 +104,7 @@ function compile(schema, root, localRefs, baseId) {
useCustomRule: useCustomRule,
opts: opts,
formats: formats,
logger: self.logger,
self: self
});
@@ -146,7 +147,7 @@ function compile(schema, root, localRefs, baseId) {
refVal[0] = validate;
} catch(e) {
console.error('Error compiling schema, function code:', sourceCode);
self.logger.error('Error compiling schema, function code:', sourceCode);
throw e;
}
@@ -260,7 +261,7 @@ function compile(schema, root, localRefs, baseId) {
var valid = validateSchema(schema);
if (!valid) {
var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);
if (self._opts.validateSchema == 'log') console.error(message);
if (self._opts.validateSchema == 'log') self.logger.error(message);
else throw new Error(message);
}
}

View File

@@ -20,7 +20,7 @@ module.exports = function rules() {
var ALL = [ 'type' ];
var KEYWORDS = [
'additionalItems', '$schema', 'id', 'title',
'additionalItems', '$schema', '$id', 'id', 'title',
'description', 'default', 'definitions'
];
var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];