|
|
@ -9,168 +9,90 @@ var validate = (function() { |
|
|
|
if ((data && typeof data === "object" && !Array.isArray(data))) { |
|
|
|
if ((data && typeof data === "object" && !Array.isArray(data))) { |
|
|
|
var errs__0 = errors; |
|
|
|
var errs__0 = errors; |
|
|
|
var valid1 = true; |
|
|
|
var valid1 = true; |
|
|
|
var data1 = data.keymaps; |
|
|
|
for (var key0 in data) { |
|
|
|
if (data1 === undefined) { |
|
|
|
var isAdditional0 = !(false || key0 == 'keymaps' || key0 == 'search' || key0 == 'properties' || key0 == 'blacklist'); |
|
|
|
valid1 = true; |
|
|
|
if (isAdditional0) { |
|
|
|
} else { |
|
|
|
valid1 = false; |
|
|
|
var errs_1 = errors; |
|
|
|
|
|
|
|
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { |
|
|
|
|
|
|
|
var errs__1 = errors; |
|
|
|
|
|
|
|
var valid2 = true; |
|
|
|
|
|
|
|
for (var key1 in data1) { |
|
|
|
|
|
|
|
if (pattern0.test(key1)) { |
|
|
|
|
|
|
|
var data2 = data1[key1]; |
|
|
|
|
|
|
|
var errs_2 = errors; |
|
|
|
|
|
|
|
if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { |
|
|
|
|
|
|
|
if (true) { |
|
|
|
|
|
|
|
var errs__2 = errors; |
|
|
|
|
|
|
|
var valid3 = true; |
|
|
|
|
|
|
|
if (data2.type === undefined) { |
|
|
|
|
|
|
|
valid3 = false; |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'required', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.keymaps[\'' + key1 + '\']', |
|
|
|
|
|
|
|
schemaPath: '#/properties/keymaps/patternProperties/.*/required', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
missingProperty: 'type' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should have required property \'type\'' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var errs_3 = errors; |
|
|
|
|
|
|
|
if (typeof data2.type !== "string") { |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.keymaps[\'' + key1 + '\'].type', |
|
|
|
|
|
|
|
schemaPath: '#/properties/keymaps/patternProperties/.*/properties/type/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'string' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be string' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid3 = errors === errs_3; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.keymaps[\'' + key1 + '\']', |
|
|
|
|
|
|
|
schemaPath: '#/properties/keymaps/patternProperties/.*/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'object' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be object' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid2 = errors === errs_2; |
|
|
|
|
|
|
|
if (!valid2) break; |
|
|
|
|
|
|
|
} else valid2 = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
validate.errors = [{ |
|
|
|
keyword: 'type', |
|
|
|
keyword: 'additionalProperties', |
|
|
|
dataPath: (dataPath || '') + '.keymaps', |
|
|
|
dataPath: (dataPath || '') + "", |
|
|
|
schemaPath: '#/properties/keymaps/type', |
|
|
|
schemaPath: '#/additionalProperties', |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
type: 'object' |
|
|
|
additionalProperty: '' + key0 + '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
message: 'should be object' |
|
|
|
message: 'should NOT have additional properties' |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
var valid1 = errors === errs_1; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (valid1) { |
|
|
|
if (valid1) { |
|
|
|
var data1 = data.search; |
|
|
|
var data1 = data.keymaps; |
|
|
|
if (data1 === undefined) { |
|
|
|
if (data1 === undefined) { |
|
|
|
valid1 = true; |
|
|
|
valid1 = true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var errs_1 = errors; |
|
|
|
var errs_1 = errors; |
|
|
|
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { |
|
|
|
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { |
|
|
|
if (true) { |
|
|
|
var errs__1 = errors; |
|
|
|
var errs__1 = errors; |
|
|
|
var valid2 = true; |
|
|
|
var valid2 = true; |
|
|
|
for (var key1 in data1) { |
|
|
|
if (data1.default === undefined) { |
|
|
|
if (pattern0.test(key1)) { |
|
|
|
valid2 = false; |
|
|
|
var data2 = data1[key1]; |
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'required', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.search', |
|
|
|
|
|
|
|
schemaPath: '#/properties/search/required', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
missingProperty: 'default' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should have required property \'default\'' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var errs_2 = errors; |
|
|
|
var errs_2 = errors; |
|
|
|
if (typeof data1.default !== "string") { |
|
|
|
if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { |
|
|
|
|
|
|
|
if (true) { |
|
|
|
|
|
|
|
var errs__2 = errors; |
|
|
|
|
|
|
|
var valid3 = true; |
|
|
|
|
|
|
|
if (data2.type === undefined) { |
|
|
|
|
|
|
|
valid3 = false; |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'required', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.keymaps[\'' + key1 + '\']', |
|
|
|
|
|
|
|
schemaPath: '#/properties/keymaps/patternProperties/.*/required', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
missingProperty: 'type' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should have required property \'type\'' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var errs_3 = errors; |
|
|
|
|
|
|
|
if (typeof data2.type !== "string") { |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.keymaps[\'' + key1 + '\'].type', |
|
|
|
|
|
|
|
schemaPath: '#/properties/keymaps/patternProperties/.*/properties/type/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'string' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be string' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid3 = errors === errs_3; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
validate.errors = [{ |
|
|
|
validate.errors = [{ |
|
|
|
keyword: 'type', |
|
|
|
keyword: 'type', |
|
|
|
dataPath: (dataPath || '') + '.search.default', |
|
|
|
dataPath: (dataPath || '') + '.keymaps[\'' + key1 + '\']', |
|
|
|
schemaPath: '#/properties/search/properties/default/type', |
|
|
|
schemaPath: '#/properties/keymaps/patternProperties/.*/type', |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
type: 'string' |
|
|
|
type: 'object' |
|
|
|
}, |
|
|
|
}, |
|
|
|
message: 'should be string' |
|
|
|
message: 'should be object' |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
var valid2 = errors === errs_2; |
|
|
|
var valid2 = errors === errs_2; |
|
|
|
} |
|
|
|
if (!valid2) break; |
|
|
|
if (valid2) { |
|
|
|
} else valid2 = true; |
|
|
|
var data2 = data1.engines; |
|
|
|
|
|
|
|
if (data2 === undefined) { |
|
|
|
|
|
|
|
valid2 = true; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var errs_2 = errors; |
|
|
|
|
|
|
|
if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { |
|
|
|
|
|
|
|
var errs__2 = errors; |
|
|
|
|
|
|
|
var valid3 = true; |
|
|
|
|
|
|
|
for (var key2 in data2) { |
|
|
|
|
|
|
|
if (pattern0.test(key2)) { |
|
|
|
|
|
|
|
var errs_3 = errors; |
|
|
|
|
|
|
|
if (typeof data2[key2] !== "string") { |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.search.engines[\'' + key2 + '\']', |
|
|
|
|
|
|
|
schemaPath: '#/properties/search/properties/engines/patternProperties/.*/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'string' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be string' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid3 = errors === errs_3; |
|
|
|
|
|
|
|
if (!valid3) break; |
|
|
|
|
|
|
|
} else valid3 = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.search.engines', |
|
|
|
|
|
|
|
schemaPath: '#/properties/search/properties/engines/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'object' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be object' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid2 = errors === errs_2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
validate.errors = [{ |
|
|
|
validate.errors = [{ |
|
|
|
keyword: 'type', |
|
|
|
keyword: 'type', |
|
|
|
dataPath: (dataPath || '') + '.search', |
|
|
|
dataPath: (dataPath || '') + '.keymaps', |
|
|
|
schemaPath: '#/properties/search/type', |
|
|
|
schemaPath: '#/properties/keymaps/type', |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
type: 'object' |
|
|
|
type: 'object' |
|
|
|
}, |
|
|
|
}, |
|
|
@ -181,65 +103,80 @@ var validate = (function() { |
|
|
|
var valid1 = errors === errs_1; |
|
|
|
var valid1 = errors === errs_1; |
|
|
|
} |
|
|
|
} |
|
|
|
if (valid1) { |
|
|
|
if (valid1) { |
|
|
|
var data1 = data.properties; |
|
|
|
var data1 = data.search; |
|
|
|
if (data1 === undefined) { |
|
|
|
if (data1 === undefined) { |
|
|
|
valid1 = true; |
|
|
|
valid1 = true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var errs_1 = errors; |
|
|
|
var errs_1 = errors; |
|
|
|
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { |
|
|
|
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { |
|
|
|
var errs__1 = errors; |
|
|
|
if (true) { |
|
|
|
var valid2 = true; |
|
|
|
var errs__1 = errors; |
|
|
|
if (data1.hintchars === undefined) { |
|
|
|
var valid2 = true; |
|
|
|
valid2 = true; |
|
|
|
if (data1.default === undefined) { |
|
|
|
} else { |
|
|
|
valid2 = false; |
|
|
|
var errs_2 = errors; |
|
|
|
|
|
|
|
if (typeof data1.hintchars !== "string") { |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
validate.errors = [{ |
|
|
|
keyword: 'type', |
|
|
|
keyword: 'required', |
|
|
|
dataPath: (dataPath || '') + '.properties.hintchars', |
|
|
|
dataPath: (dataPath || '') + '.search', |
|
|
|
schemaPath: '#/properties/properties/properties/hintchars/type', |
|
|
|
schemaPath: '#/properties/search/required', |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
type: 'string' |
|
|
|
missingProperty: 'default' |
|
|
|
}, |
|
|
|
}, |
|
|
|
message: 'should be string' |
|
|
|
message: 'should have required property \'default\'' |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
var valid2 = errors === errs_2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (valid2) { |
|
|
|
|
|
|
|
if (data1.smoothscroll === undefined) { |
|
|
|
|
|
|
|
valid2 = true; |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var errs_2 = errors; |
|
|
|
var errs_2 = errors; |
|
|
|
if (typeof data1.smoothscroll !== "boolean") { |
|
|
|
if (typeof data1.default !== "string") { |
|
|
|
validate.errors = [{ |
|
|
|
validate.errors = [{ |
|
|
|
keyword: 'type', |
|
|
|
keyword: 'type', |
|
|
|
dataPath: (dataPath || '') + '.properties.smoothscroll', |
|
|
|
dataPath: (dataPath || '') + '.search.default', |
|
|
|
schemaPath: '#/properties/properties/properties/smoothscroll/type', |
|
|
|
schemaPath: '#/properties/search/properties/default/type', |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
type: 'boolean' |
|
|
|
type: 'string' |
|
|
|
}, |
|
|
|
}, |
|
|
|
message: 'should be boolean' |
|
|
|
message: 'should be string' |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
var valid2 = errors === errs_2; |
|
|
|
var valid2 = errors === errs_2; |
|
|
|
} |
|
|
|
} |
|
|
|
if (valid2) { |
|
|
|
if (valid2) { |
|
|
|
if (data1.complete === undefined) { |
|
|
|
var data2 = data1.engines; |
|
|
|
|
|
|
|
if (data2 === undefined) { |
|
|
|
valid2 = true; |
|
|
|
valid2 = true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var errs_2 = errors; |
|
|
|
var errs_2 = errors; |
|
|
|
if (typeof data1.complete !== "string") { |
|
|
|
if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { |
|
|
|
|
|
|
|
var errs__2 = errors; |
|
|
|
|
|
|
|
var valid3 = true; |
|
|
|
|
|
|
|
for (var key2 in data2) { |
|
|
|
|
|
|
|
if (pattern0.test(key2)) { |
|
|
|
|
|
|
|
var errs_3 = errors; |
|
|
|
|
|
|
|
if (typeof data2[key2] !== "string") { |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.search.engines[\'' + key2 + '\']', |
|
|
|
|
|
|
|
schemaPath: '#/properties/search/properties/engines/patternProperties/.*/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'string' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be string' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid3 = errors === errs_3; |
|
|
|
|
|
|
|
if (!valid3) break; |
|
|
|
|
|
|
|
} else valid3 = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
validate.errors = [{ |
|
|
|
validate.errors = [{ |
|
|
|
keyword: 'type', |
|
|
|
keyword: 'type', |
|
|
|
dataPath: (dataPath || '') + '.properties.complete', |
|
|
|
dataPath: (dataPath || '') + '.search.engines', |
|
|
|
schemaPath: '#/properties/properties/properties/complete/type', |
|
|
|
schemaPath: '#/properties/search/properties/engines/type', |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
type: 'string' |
|
|
|
type: 'object' |
|
|
|
}, |
|
|
|
}, |
|
|
|
message: 'should be string' |
|
|
|
message: 'should be object' |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
@ -250,8 +187,8 @@ var validate = (function() { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
validate.errors = [{ |
|
|
|
validate.errors = [{ |
|
|
|
keyword: 'type', |
|
|
|
keyword: 'type', |
|
|
|
dataPath: (dataPath || '') + '.properties', |
|
|
|
dataPath: (dataPath || '') + '.search', |
|
|
|
schemaPath: '#/properties/properties/type', |
|
|
|
schemaPath: '#/properties/search/type', |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
type: 'object' |
|
|
|
type: 'object' |
|
|
|
}, |
|
|
|
}, |
|
|
@ -262,123 +199,148 @@ var validate = (function() { |
|
|
|
var valid1 = errors === errs_1; |
|
|
|
var valid1 = errors === errs_1; |
|
|
|
} |
|
|
|
} |
|
|
|
if (valid1) { |
|
|
|
if (valid1) { |
|
|
|
var data1 = data.blacklist; |
|
|
|
var data1 = data.properties; |
|
|
|
if (data1 === undefined) { |
|
|
|
if (data1 === undefined) { |
|
|
|
valid1 = true; |
|
|
|
valid1 = true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var errs_1 = errors; |
|
|
|
var errs_1 = errors; |
|
|
|
if (Array.isArray(data1)) { |
|
|
|
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { |
|
|
|
var errs__1 = errors; |
|
|
|
var errs__1 = errors; |
|
|
|
var valid1; |
|
|
|
var valid2 = true; |
|
|
|
for (var i1 = 0; i1 < data1.length; i1++) { |
|
|
|
if (data1.hintchars === undefined) { |
|
|
|
var data2 = data1[i1]; |
|
|
|
valid2 = true; |
|
|
|
|
|
|
|
} else { |
|
|
|
var errs_2 = errors; |
|
|
|
var errs_2 = errors; |
|
|
|
var errs__2 = errors; |
|
|
|
if (typeof data1.hintchars !== "string") { |
|
|
|
var valid2 = false; |
|
|
|
validate.errors = [{ |
|
|
|
var errs_3 = errors; |
|
|
|
|
|
|
|
if (typeof data2 !== "string") { |
|
|
|
|
|
|
|
var err = { |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
keyword: 'type', |
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']', |
|
|
|
dataPath: (dataPath || '') + '.properties.hintchars', |
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/0/type', |
|
|
|
schemaPath: '#/properties/properties/properties/hintchars/type', |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
type: 'string' |
|
|
|
type: 'string' |
|
|
|
}, |
|
|
|
}, |
|
|
|
message: 'should be string' |
|
|
|
message: 'should be string' |
|
|
|
}; |
|
|
|
}]; |
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
return false; |
|
|
|
else vErrors.push(err); |
|
|
|
} |
|
|
|
errors++; |
|
|
|
var valid2 = errors === errs_2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (valid2) { |
|
|
|
|
|
|
|
if (data1.smoothscroll === undefined) { |
|
|
|
|
|
|
|
valid2 = true; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var errs_2 = errors; |
|
|
|
|
|
|
|
if (typeof data1.smoothscroll !== "boolean") { |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.properties.smoothscroll', |
|
|
|
|
|
|
|
schemaPath: '#/properties/properties/properties/smoothscroll/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'boolean' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be boolean' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid2 = errors === errs_2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (valid2) { |
|
|
|
|
|
|
|
if (data1.complete === undefined) { |
|
|
|
|
|
|
|
valid2 = true; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var errs_2 = errors; |
|
|
|
|
|
|
|
if (typeof data1.complete !== "string") { |
|
|
|
|
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.properties.complete', |
|
|
|
|
|
|
|
schemaPath: '#/properties/properties/properties/complete/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'string' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be string' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid2 = errors === errs_2; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
var valid3 = errors === errs_3; |
|
|
|
} |
|
|
|
valid2 = valid2 || valid3; |
|
|
|
} else { |
|
|
|
if (!valid2) { |
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.properties', |
|
|
|
|
|
|
|
schemaPath: '#/properties/properties/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'object' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be object' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid1 = errors === errs_1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (valid1) { |
|
|
|
|
|
|
|
var data1 = data.blacklist; |
|
|
|
|
|
|
|
if (data1 === undefined) { |
|
|
|
|
|
|
|
valid1 = true; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var errs_1 = errors; |
|
|
|
|
|
|
|
if (Array.isArray(data1)) { |
|
|
|
|
|
|
|
var errs__1 = errors; |
|
|
|
|
|
|
|
var valid1; |
|
|
|
|
|
|
|
for (var i1 = 0; i1 < data1.length; i1++) { |
|
|
|
|
|
|
|
var data2 = data1[i1]; |
|
|
|
|
|
|
|
var errs_2 = errors; |
|
|
|
|
|
|
|
var errs__2 = errors; |
|
|
|
|
|
|
|
var valid2 = false; |
|
|
|
var errs_3 = errors; |
|
|
|
var errs_3 = errors; |
|
|
|
if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { |
|
|
|
if (typeof data2 !== "string") { |
|
|
|
if (true) { |
|
|
|
var err = { |
|
|
|
var errs__3 = errors; |
|
|
|
keyword: 'type', |
|
|
|
var valid4 = true; |
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']', |
|
|
|
if (data2.url === undefined) { |
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/0/type', |
|
|
|
valid4 = false; |
|
|
|
params: { |
|
|
|
var err = { |
|
|
|
type: 'string' |
|
|
|
keyword: 'required', |
|
|
|
}, |
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']', |
|
|
|
message: 'should be string' |
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/required', |
|
|
|
}; |
|
|
|
params: { |
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
missingProperty: 'url' |
|
|
|
else vErrors.push(err); |
|
|
|
}, |
|
|
|
errors++; |
|
|
|
message: 'should have required property \'url\'' |
|
|
|
} |
|
|
|
}; |
|
|
|
var valid3 = errors === errs_3; |
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
valid2 = valid2 || valid3; |
|
|
|
else vErrors.push(err); |
|
|
|
if (!valid2) { |
|
|
|
errors++; |
|
|
|
var errs_3 = errors; |
|
|
|
} else { |
|
|
|
if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { |
|
|
|
var errs_4 = errors; |
|
|
|
if (true) { |
|
|
|
if (typeof data2.url !== "string") { |
|
|
|
var errs__3 = errors; |
|
|
|
var err = { |
|
|
|
var valid4 = true; |
|
|
|
keyword: 'type', |
|
|
|
if (data2.url === undefined) { |
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + '].url', |
|
|
|
|
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/properties/url/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'string' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be string' |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
|
|
|
|
else vErrors.push(err); |
|
|
|
|
|
|
|
errors++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid4 = errors === errs_4; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (valid4) { |
|
|
|
|
|
|
|
var data3 = data2.keys; |
|
|
|
|
|
|
|
if (data3 === undefined) { |
|
|
|
|
|
|
|
valid4 = false; |
|
|
|
valid4 = false; |
|
|
|
var err = { |
|
|
|
var err = { |
|
|
|
keyword: 'required', |
|
|
|
keyword: 'required', |
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']', |
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']', |
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/required', |
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/required', |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
missingProperty: 'keys' |
|
|
|
missingProperty: 'url' |
|
|
|
}, |
|
|
|
}, |
|
|
|
message: 'should have required property \'keys\'' |
|
|
|
message: 'should have required property \'url\'' |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
else vErrors.push(err); |
|
|
|
else vErrors.push(err); |
|
|
|
errors++; |
|
|
|
errors++; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var errs_4 = errors; |
|
|
|
var errs_4 = errors; |
|
|
|
if (Array.isArray(data3)) { |
|
|
|
if (typeof data2.url !== "string") { |
|
|
|
var errs__4 = errors; |
|
|
|
|
|
|
|
var valid4; |
|
|
|
|
|
|
|
for (var i4 = 0; i4 < data3.length; i4++) { |
|
|
|
|
|
|
|
var errs_5 = errors; |
|
|
|
|
|
|
|
if (typeof data3[i4] !== "string") { |
|
|
|
|
|
|
|
var err = { |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + '].keys[' + i4 + ']', |
|
|
|
|
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/properties/keys/items/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'string' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be string' |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
|
|
|
|
else vErrors.push(err); |
|
|
|
|
|
|
|
errors++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid5 = errors === errs_5; |
|
|
|
|
|
|
|
if (!valid5) break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var err = { |
|
|
|
var err = { |
|
|
|
keyword: 'type', |
|
|
|
keyword: 'type', |
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + '].keys', |
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + '].url', |
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/properties/keys/type', |
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/properties/url/type', |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
type: 'array' |
|
|
|
type: 'string' |
|
|
|
}, |
|
|
|
}, |
|
|
|
message: 'should be array' |
|
|
|
message: 'should be string' |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
else vErrors.push(err); |
|
|
|
else vErrors.push(err); |
|
|
@ -386,61 +348,118 @@ var validate = (function() { |
|
|
|
} |
|
|
|
} |
|
|
|
var valid4 = errors === errs_4; |
|
|
|
var valid4 = errors === errs_4; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (valid4) { |
|
|
|
|
|
|
|
var data3 = data2.keys; |
|
|
|
|
|
|
|
if (data3 === undefined) { |
|
|
|
|
|
|
|
valid4 = false; |
|
|
|
|
|
|
|
var err = { |
|
|
|
|
|
|
|
keyword: 'required', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']', |
|
|
|
|
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/required', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
missingProperty: 'keys' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should have required property \'keys\'' |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
|
|
|
|
else vErrors.push(err); |
|
|
|
|
|
|
|
errors++; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var errs_4 = errors; |
|
|
|
|
|
|
|
if (Array.isArray(data3)) { |
|
|
|
|
|
|
|
var errs__4 = errors; |
|
|
|
|
|
|
|
var valid4; |
|
|
|
|
|
|
|
for (var i4 = 0; i4 < data3.length; i4++) { |
|
|
|
|
|
|
|
var errs_5 = errors; |
|
|
|
|
|
|
|
if (typeof data3[i4] !== "string") { |
|
|
|
|
|
|
|
var err = { |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + '].keys[' + i4 + ']', |
|
|
|
|
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/properties/keys/items/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'string' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be string' |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
|
|
|
|
else vErrors.push(err); |
|
|
|
|
|
|
|
errors++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid5 = errors === errs_5; |
|
|
|
|
|
|
|
if (!valid5) break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var err = { |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + '].keys', |
|
|
|
|
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/properties/keys/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'array' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be array' |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
|
|
|
|
else vErrors.push(err); |
|
|
|
|
|
|
|
errors++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var valid4 = errors === errs_4; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var err = { |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']', |
|
|
|
|
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'object' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be object' |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
|
|
|
|
else vErrors.push(err); |
|
|
|
|
|
|
|
errors++; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
var valid3 = errors === errs_3; |
|
|
|
|
|
|
|
valid2 = valid2 || valid3; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!valid2) { |
|
|
|
var err = { |
|
|
|
var err = { |
|
|
|
keyword: 'type', |
|
|
|
keyword: 'anyOf', |
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']', |
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']', |
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf/1/type', |
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf', |
|
|
|
params: { |
|
|
|
params: {}, |
|
|
|
type: 'object' |
|
|
|
message: 'should match some schema in anyOf' |
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be object' |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
else vErrors.push(err); |
|
|
|
else vErrors.push(err); |
|
|
|
errors++; |
|
|
|
errors++; |
|
|
|
|
|
|
|
validate.errors = vErrors; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
errors = errs__2; |
|
|
|
|
|
|
|
if (vErrors !== null) { |
|
|
|
|
|
|
|
if (errs__2) vErrors.length = errs__2; |
|
|
|
|
|
|
|
else vErrors = null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
var valid3 = errors === errs_3; |
|
|
|
var valid2 = errors === errs_2; |
|
|
|
valid2 = valid2 || valid3; |
|
|
|
if (!valid2) break; |
|
|
|
} |
|
|
|
|
|
|
|
if (!valid2) { |
|
|
|
|
|
|
|
var err = { |
|
|
|
|
|
|
|
keyword: 'anyOf', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']', |
|
|
|
|
|
|
|
schemaPath: '#/properties/blacklist/items/anyOf', |
|
|
|
|
|
|
|
params: {}, |
|
|
|
|
|
|
|
message: 'should match some schema in anyOf' |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
if (vErrors === null) vErrors = [err]; |
|
|
|
|
|
|
|
else vErrors.push(err); |
|
|
|
|
|
|
|
errors++; |
|
|
|
|
|
|
|
validate.errors = vErrors; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
errors = errs__2; |
|
|
|
|
|
|
|
if (vErrors !== null) { |
|
|
|
|
|
|
|
if (errs__2) vErrors.length = errs__2; |
|
|
|
|
|
|
|
else vErrors = null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
var valid2 = errors === errs_2; |
|
|
|
} else { |
|
|
|
if (!valid2) break; |
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.blacklist', |
|
|
|
|
|
|
|
schemaPath: '#/properties/blacklist/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'array' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be array' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
var valid1 = errors === errs_1; |
|
|
|
validate.errors = [{ |
|
|
|
|
|
|
|
keyword: 'type', |
|
|
|
|
|
|
|
dataPath: (dataPath || '') + '.blacklist', |
|
|
|
|
|
|
|
schemaPath: '#/properties/blacklist/type', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
type: 'array' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
message: 'should be array' |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
var valid1 = errors === errs_1; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -531,7 +550,8 @@ validate.schema = { |
|
|
|
}] |
|
|
|
}] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
"additionalProperties": false |
|
|
|
}; |
|
|
|
}; |
|
|
|
validate.errors = null; |
|
|
|
validate.errors = null; |
|
|
|
module.exports = validate; |
|
|
|
module.exports = validate; |